不用写软件,纯JS 实现QQ空间自动点赞

时间:2021-07-27 14:56:44

这里分享一个自己写的点赞JS,已实现了好友动态、右侧栏猜你喜欢 点赞,有兴趣的朋友可以加上去玩玩。打开浏览器的开发者模式运行就可以看到效果了

    var count = 0;
var total = 0;
function ilike() {
var b = document.getElementById("fhp_like"); //右侧栏 猜你喜欢 点赞
var c = b.childNodes[1];
console.log(c.childNodes.length);
for (var i = 0; i < c.childNodes.length; i++) {
var a1 = c.childNodes[i];
if (a1.getAttribute('style').indexOf('block') > 0) {
if (a1.innerHTML.indexOf('已赞') > 0) {
var r = b.parentNode; r.lastChild.click();
console.log(r.lastChild);
}
else {
a1.click();
console.log(a1.innerHTML);
}
}
}
count++;
var j = document.getElementsByClassName("item qz_like_btn_v3"); //好友动态点赞 for (var i = total; i < j.length; i++) {
if (j[i].innerHTML.indexOf('取消赞') == -1) {
j[i].click();
}
total++;
} window.document.body.scrollTop = window.document.body.scrollHeight - 1000;
window.document.body.scrollTop = window.document.body.scrollHeight - 200;
window.document.body.scrollTop = window.document.body.scrollHeight - 800;
window.document.body.scrollTop = window.document.body.scrollHeight;
console.log("已执行" + (count + total) + "条");
setTimeout("ilike()", 2000);
} setTimeout("ilike()", 2000);