zoukankan      html  css  js  c++  java
  • 抓取[今日新闻]应用的数据

     /// <summary>
            /// 今日新闻
            /// </summary>
            /// <returns></returns>
            public ActionResult TestJson()
            {
                HttpWebRequest request = HttpWebRequest.Create("http://ic.snssdk.com/2/article/
    information/v6/?group_id=3492328915&context=1&iid=2296969961&device_id=2728271877&
    ac=wifi&channel=hiapk&aid=13&app_name=news_article&version_code=360&device_platform=
    android&device_type=Samsung%20Galaxy%20S4%20-%204.2.2%20-%20API%2017%20-%201080x1920&os_api=
    17&os_version=4.2.2&openudid=e233a028a3869d01
    ") as HttpWebRequest; HttpWebResponse response = (HttpWebResponse)request.GetResponse(); Stream sr = response.GetResponseStream(); string StrData = new StreamReader(sr).ReadToEnd(); JsonData data = JsonConvert.DeserializeObject<JsonData>(StrData); return View(); }

    //用到的实体

    #region 【(今日头条)的新闻类】
        /// <summary>
        /// 相应的json
        /// </summary>
        public class JsonData
        {
            public string message { get; set; }
            public NewsData data { get; set; }
        }
        /// <summary>
        /// 新闻数据
        /// </summary>
        public class NewsData
        {
            public string context { get; set; }
            public int bury_count { get; set; }
            public int user_bury { get; set; }
            public int ban_comment { get; set; }
            public int repin_count { get; set; }
            public string url { get; set; }
            public int digg_count { get; set; }
    
            public string share_url { get; set; }
            public string source { get; set; }
    
            public int user_repin { get; set; }
            public int user_digg { get; set; }
            public double group_id { get; set; }
            public int delete { get; set; }
    
            public List<label_list> label_list { get; set; }
            public List<related_news> related_news { get; set; }
        }
        /// <summary>
        /// 标签列表
        /// </summary>
        public class label_list
        {
            public string name { get; set; }
            public string label { get; set; }
        }
        /// <summary>
        /// 相关新闻
        /// </summary>
        public class related_news
        {
            public string group_id { get; set; }
            public string title { get; set; }
        }
        #endregion
  • 相关阅读:
    SSIS 小脚本 文件路径验证
    SSIS 小脚本 时间参数验证
    索引 唯一索引设计指南
    容易遗忘的一些小代码之 ROW_NUMBER 和去重
    MSDNMDX#001 多维表达式 (MDX) 参考
    数据库引擎 页和区体系结构页和区
    数据库引擎 文件和文件组体系结构
    索引 索引键的最大大小
    索引 在文件组上放置索引
    索引 常规索引设计指南
  • 原文地址:https://www.cnblogs.com/sumg/p/3940264.html
Copyright © 2011-2022 走看看