新聞接口調用之新浪滾動新聞


在網上在api,找了一會兒都沒發現,只能自己研究了

首先附上調用地址 : http://roll.news.sina.com.cn/interface/rollnews_ch_out_interface.php

新聞類別     col          取值(90:國內,91:國際,92:社會,94:體育,95:娛樂,93:軍事,96:科技,97:財經,98:股市,99:美股)

http://roll.news.sina.com.cn/interface/rollnews_ch_out_interface.php?col=90,91

新聞形式     type       取值(3:視頻,2:圖片,空:全部)

http://roll.news.sina.com.cn/interface/rollnews_ch_out_interface.php?col=90,91&type=

http://roll.news.sina.com.cn/interface/rollnews_ch_out_interface.php?col=90,91&type=2

新聞條數     num

http://roll.news.sina.com.cn/interface/rollnews_ch_out_interface.php?col=90,91&type=2&num=5

返回數據為json:

var jsonData = { serverSeconds : 1402643427, last_time : 1402643219, path : [{title : "全部", id : "89", cType : "col"}], count : 19827, offset_page : 0, offset_num : 0, list : [     {channel : {title : "娛樂",id : "95",cType : "col",url : ""},title : "41歲闊太黎瑞恩離婚 可分得千萬家產",url : "http://ent.sina.com.cn/s/h/2014-06-13/15064158203.shtml",type : '1',pic : '',time : 1402643219}] };

 

 

格式化后的jaon數據(去掉了頭部的var jsonData =  和尾部的 ; )

 1 {
 2     "serverSeconds": 1402643427, 
 3     "last_time": 1402643219, 
 4     "path": [
 5         {
 6             "title": "全部", 
 7             "id": "89", 
 8             "cType": "col"
 9         }
10     ], 
11     "count": 19827, 
12     "offset_page": 0, 
13     "offset_num": 0, 
14     "list": [
15         {
16             "channel": {
17                 "title": "娛樂", 
18                 "id": "95", 
19                 "cType": "col", 
20                 "url": ""
21             }, 
22             "title": "41歲闊太黎瑞恩離婚 可分得千萬家產", 
23             "url": "http://ent.sina.com.cn/s/h/2014-06-13/15064158203.shtml", 
24             "type": "1", 
25             "pic": "", 
26             "time": 1402643219
27         }
28     ]
29 }

 

需要的朋友各取所需吧

 

轉載請注明: 林夕木大大

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM