请知悉:本文最近一次更新为 9年 前,文中内容可能已经过时。

写个函数,利用Greasemonkey根据域名抓取域名下的谷歌索引数量:

function checkgoogle(domain){
console.log("检查域名谷歌收录:"+domain);
GM_xmlhttpRequest({
method: "GET",
url: "https://ajax.googleapis.com/ajax/services/search/web v=1.0&q=site:"+domain+"&filter=0",
headers: {
"User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0"
},
onload: function(response) {
result=JSON.parse(response.responseText);
if(result.responseStatus==403){
alert("请求被拒绝,请休息片刻再尝试");
clearTimeout(interval);
return false;
}
console.log(result);
sietnums=parseInt(result.responseData.cursor.resultCount);
console.log("收录数量:"+sietnums);
}
});
}

如您从本文得到了有价值的信息或帮助,请考虑扫描文末二维码捐赠和鼓励。

尊重他人劳动成果。转载请务必附上原文链接,我将感激不尽。


与《Greasemonkey使用谷歌搜索API获取搜索结果》相关的博文:


留言

avatar
😀
😀😁😂😅😭🤭😋😘🤔😰😱🤪💪👍👎🤝🌹👌