搜狗搜索.js 707 字节
Newer Older
H
hjdhnx 已提交
1 2 3
js:
let d=[];
let html = request(input);
H
hjdhnx 已提交
4 5
// print(html);
let jsonA = JSON.parse(html.match(/INITIAL_STATE.*?({.*});/)[1]);
H
hjdhnx 已提交
6
// print(jsonA);
H
hjdhnx 已提交
7
jsonA = jsonA.result.longVideo.results;
H
hjdhnx 已提交
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
jsonA.forEach(function (it){
    let name=it.name;
    let introduction=it.introduction;
    let pic= it.v_picurl;
    let url= it.tiny_url;
    let zone=it.zone;
    let score=it.score||'暂无';
    let style=it.style;
    if(it.play.item_list){
        let r = {};
        r.title = name.replace(//,'').replace(//,'');
        r.url= 'https://v.sogou.com'+url;
        r.desc = it.list_category.join(',');
        r.content= introduction;
        r.pic_url= pic;
        d.push(r);
    }
});
// print(d);
setResult(d);