-
-
Save lackneets/acd18238c804ce3e11ca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setInterval(function () { | |
// 取得網頁上所有連結 | |
var a = document.getElementsByTagName('a'); | |
// 針對每個連結跑一次 | |
for (var i in a) { | |
// 檢查是不是真的是連結 | |
if (a.hasOwnProperty(i)) { | |
// 檢查是不是讚的連結 | |
if (a[i].className == "UFILikeLink") { | |
// 檢查是不是還沒按過讚 | |
if (a[i].title == "覺得這很讚") { | |
// 檢查能不能點下去 | |
if (a[i].click) { | |
// 點下去 | |
a[i].click(); | |
// 在 console 顯示已讚字樣 | |
console.log('已讚', i); | |
} | |
} | |
} | |
} | |
} | |
}, 200); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function autoPoke() { | |
function clickAll(elements) { | |
for (var i in elements) { | |
if (elements.hasOwnProperty(i) && elements[i].click) { | |
elements[i].click(); | |
} | |
} | |
} | |
var pokeTimer = setInterval(function () { | |
var a = $$("._42ft._4jy0._4jy3._4jy1.selected"); | |
clickAll(a); | |
console.log('戳戳戳...') | |
if ($$("._42ft._4jy0._4jy3._4jy1.selected.layerCancel").length) { | |
clearInterval(pokeTimer); | |
console.log('戳爆了,下次再玩'); | |
//因為 modal 顯示需要時間 | |
setTimeout(function () { | |
clickAll($$("._42ft._4jy0._4jy3._4jy1.selected.layerCancel")); | |
}, 600); | |
return; | |
} | |
}, 800); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment