sencha-touch中通过JsonP来获取优酷数据~

发布时间:2016-12-11 6:39:47 编辑:www.fx114.net 分享查询网我要评论
本篇文章主要介绍了"sencha-touch中通过JsonP来获取优酷数据~",主要涉及到sencha-touch中通过JsonP来获取优酷数据~方面的内容,对于sencha-touch中通过JsonP来获取优酷数据~感兴趣的同学可以参考一下。

使用优酷api请求数据,原url如:https://openapi.youku.com/v2/searches/show/top_unite.json?_dc=1393066615798&client_id=753b1d1e778c3dca&category=电视剧&genre=1007&area=1001&year=2014&orderby=1&headnum=1&tailnum=1&onesiteflag=0&page=1&count=20,在sencha-touch中向优酷服务器发送请求获取数据,用ajax时出现了错误,故改成如下的方法(已认证可用~): Ext.data.JsonP.request({ url : 'https://openapi.youku.com/v2/searches/show/top_unite.json', method : 'get', callbackKey : 'callback', params : { client_id : this.getClient_ID(), category : '电视剧', genre : 1007, area : 1001, year : 2014, orderby : 1, headnum : 1, tailnum : 1, onesiteflag : 0, page : 1, count : 20, }, success : function(result, request) {     alert(result.data[0].director);   },   failure : function(result, request) {      alert("error");   } }); 服务器返回的数据如: e:- { provider: "searches.soku.top", code: 0, desc: "OK" }, total: 5, cost: 11, data:- [ -{ preSize: 45, programmeId: 277932, name: "隋唐英雄3", director:- [ "李翰韬" ], performer:- [ "郑国霖", "张卫健", "刘晓庆" ], host:[], singer:[], genre:- [ "剧情", "历史", "古装" ], area:- [ "大陆" ], score: 6.705999851226807, vpic: "http://g3.ykimg.com/0516000051B03E996758394ABB0C0E34", pic: "http://g3.ykimg.com/050B000051B03E83675839362B0AE8F2", brief: "玄武门之变后,李世民登上皇位,但隋朝的残余势力和十八反王留下来的军队仍在北漠兴风作浪,危害百姓。罗通、程铁牛、秦怀玉等一批小将已长大成人,罗通夺得帅位,率领唐军出征,扫平了北漠。此时渤辽国又兴兵攻唐,程咬金挂帅,在龙门县招兵,薛仁贵泪别柳金花去当兵,军营中,薛仁贵被人冒功,只当了个火头军,但他没有放弃,凭着一身本领,屡立战功,终于得到程咬金的赏识,被程咬金举荐为先锋大将,薛仁贵率领唐军平定了渤辽国。柳金花在寒窑中苦等丈夫十年,薛仁贵功成之后,不忘糟糠之妻,回龙门与妻儿相会。同时,李世民在魏征、长孙无忌等贤臣的辅佐下,励精图治,开创了贞观盛世。", subtitle: "黄海冰郑国霖续兄弟情", playurl: "http://tv.sohu.com/20140129/n394357587.shtml", trailerUrl: "http://v.youku.com/v_show/id_XNjYyOTAwMzAw.html", hd: 0, displaystatus: "更新至58集", paid: 0, totalvv: 243462, detailUrlYouku: "http://www.youku.com/show_page/id_z9c1676a2b91e11e2a19e.html", detailUrlSoku: "/detail/show/XMTExMTcyOA==", releaseDate: "2014-00-00", releaseYear: "2014", completed: 0, animeEdition: "0", zhengPian: "b,c", haveMinorList: true, queryCount: 91705, programmeSite:- [ -{ pre: " ", siteId: 6, hd: 0, episodeCollected: 58, displaystatus: "更新至58集", episode:- [ -{ pre: " ", name: "隋唐英雄3第1集", url: "http://tv.sohu.com/20140129/n394357587.shtml", orderStage: 1, lastUpdate: 1390924800, tagType: 0 }, -{ pre: " ", name: "隋唐英雄3第58集", url: "http://tv.sohu.com/20140222/n395464374.shtml?txid=8254069965286abe9ee523a73c256ea7", orderStage: 58, lastUpdate: 1392998400, tagType: 1 } ] }, ] } ] 这样运行程序,提示框显示的为: 李翰韬 e:- { provider: "searches.soku.top", code: 0, desc: "OK" }, total: 5, cost: 11, data:- [ -{ preSize: 45, programmeId: 277932, name: "隋唐英雄3", director:- [ "李翰韬" ], performer:- [ "郑国霖", "张卫健", "刘晓庆" ], host:[], singer:[], genre:- [ "剧情", "历史", "古装" ], area:- [ "大陆" ], score: 6.705999851226807, vpic: "http://g3.ykimg.com/0516000051B03E996758394ABB0C0E34", pic: "http://g3.ykimg.com/050B000051B03E83675839362B0AE8F2", brief: "玄武门之变后,李世民登上皇位,但隋朝的残余势力和十八反王留下来的军队仍在北漠兴风作浪,危害百姓。罗通、程铁牛、秦怀玉等一批小将已长大成人,罗通夺得帅位,率领唐军出征,扫平了北漠。此时渤辽国又兴兵攻唐,程咬金挂帅,在龙门县招兵,薛仁贵泪别柳金花去当兵,军营中,薛仁贵被人冒功,只当了个火头军,但他没有放弃,凭着一身本领,屡立战功,终于得到程咬金的赏识,被程咬金举荐为先锋大将,薛仁贵率领唐军平定了渤辽国。柳金花在寒窑中苦等丈夫十年,薛仁贵功成之后,不忘糟糠之妻,回龙门与妻儿相会。同时,李世民在魏征、长孙无忌等贤臣的辅佐下,励精图治,开创了贞观盛世。", subtitle: "黄海冰郑国霖续兄弟情", playurl: "http://tv.sohu.com/20140129/n394357587.shtml", trailerUrl: "http://v.youku.com/v_show/id_XNjYyOTAwMzAw.html", hd: 0, displaystatus: "更新至58集", paid: 0, totalvv: 243462, detailUrlYouku: "http://www.youku.com/show_page/id_z9c1676a2b91e11e2a19e.html", detailUrlSoku: "/detail/show/XMTExMTcyOA==", releaseDate: "2014-00-00", releaseYear: "2014", completed: 0, animeEdition: "0", zhengPian: "b,c", haveMinorList: true, queryCount: 91705, programmeSite:- [ -{ pre: " ", siteId: 6, hd: 0, episodeCollected: 58, displaystatus: "更新至58集", episode:- [ -{ pre: " ", name: "隋唐英雄3第1集", url: "http://tv.sohu.com/20140129/n394357587.shtml", orderStage: 1, lastUpdate: 1390924800, tagType: 0 }, -{ pre: " ", name: "隋唐英雄3第58集", url: "http://tv.sohu.com/20140222/n395464374.shtml?txid=8254069965286abe9ee523a73c256ea7", orderStage: 58, lastUpdate: 1392998400, tagType: 1 } ] }, -{ pre: " ", siteId: 17, hd: 0, episodeCollected: 58, displaystatus: "更新至58集", episode:- [ -{ pre: " ", name: "隋唐英雄3 01", url: "http://www.letv.com/ptv/vplay/2252104.html", orderStage: 1, lastUpdate: 1390924800, tagType: 0 }, -{ pre: " ", name: "隋唐英雄3 58", url: "http://www.letv.com/ptv/vplay/2270883.html", orderStage: 58, lastUpdate: 1392998400, tagType: 1 } ] }, -{ pre: " ", siteId: 19, hd: 0, episodeCollected: 58, displaystatus: "更新至58集", episode:- [ -{ pre: " ", name: "隋唐英雄3第1集", url: "http://www.iqiyi.com/v_19rrgyogws.html", orderStage: 1, lastUpdate: 1390924800, tagType: 0 }, -{ pre: " ", name: "隋唐英雄3第58集", url: "http://www.iqiyi.com/v_19rrgxpc4o.html", orderStage: 58, lastUpdate: 1392998400, tagType: 1 } ] }, -{ pre: " ", siteId: 130, hd: 0, episodeCollected: 58, displaystatus: "更新至58集", episode:- [ -{ pre: " ", name: "隋唐英雄3 第1集", url: "http://www.funshion.com/vplay/m-111671.e-1", orderStage: 1, lastUpdate: 1390924800, tagType: 0 }, -{ pre: " ", name: "隋唐英雄3 第58集", url: "http://www.funshion.com/vplay/m-111671.e-58", orderStage: 58, lastUpdate: 1392998400, tagType: 1 } ] }, -{ pre: " ", siteId: 27, hd: 0, episodeCollected: 57, displaystatus: "更新至58集", episode:- [ -{ pre: " ", name: "隋唐英雄3 TV版 第01集", url: "http://v.qq.com/cover/2/2hwvjmmzfubodxt/t0013zvqdwo.html", orderStage: 1, lastUpdate: 1392480000, tagType: 0 }, -{ pre: " ", name: "隋唐英雄3 第58集", url: "http://v.qq.com/cover/2/2hwvjmmzfubodxt/v0013qscvd2.html", orderStage: 58, lastUpdate: 1392998400, tagType: 1 } ] }, -{ pre: " ", siteId: 3, hd: 0, episodeCollected: 49, displaystatus: "更新至49集", episode:- [ -{ pre: " ", name: "1", url: "http://video.sina.com.cn/m/201401160532608_63448691.html", orderStage: 1, lastUpdate: 1390924800, tagType: 0 }, -{ pre: " ", name: "49", url: "http://video.sina.com.cn/m/201401160532608_63525917.html", orderStage: 49, lastUpdate: 1392912000, tagType: 1 } ] }, -{ pre: " ", siteId: 131, hd: 0, episodeCollected: 49, displaystatus: "更新至49集", episode:- [ -{ pre: " ", name: "隋唐英雄3 第1集", url: "http://www.wasu.cn/Play/show/id/2134923?refer=www.soku.com", orderStage: 1, lastUpdate: 1390924800, tagType: 0 }, -{ pre: " ", name: "隋唐英雄3 第49集", url: "http://www.wasu.cn/Play/show/id/2192523?refer=www.soku.com", orderStage: 49, lastUpdate: 1392912000, tagType: 1 } ] }, -{ pre: " ", siteId: 83, hd: 0, episodeCollected: 46, displaystatus: "更新至49集", episode:- [ -{ pre: " ", name: "隋唐英雄III臻高清-01", url: "http://v.pps.tv/play_3C456X.html#from_soku", orderStage: 1, lastUpdate: 1390924800, tagType: 0 }, -{ pre: " ", name: "隋唐英雄III超清版-49", url: "http://v.pps.tv/play_3CNNDI.html#from_soku", orderStage: 49, lastUpdate: 1392912000, tagType: 1 } ] } ] },

上一篇:Android初学者之ContentValues
下一篇:Java 里的字符串处理类StringBuffer简介

相关文章

相关评论