View difference between Paste ID: e8Fhb0Dx and zdJkjyjC
SHOW: | | - or go back to the newest paste.
1
// ==UserScript==
2
// @name         초이스 랜덤 번호 자동 투표 후 닫기
3
// @namespace    http://tampermonkey.net/
4
// @version      0.3
5
// @description  try to take over the world!
6
// @author       할붕이
7
// @match        https://m.kin.naver.com/mobile/choice/detail?*
8
// @grant        window.close
9
// ==/UserScript==
10
11
(function() {
12
    function aaa(bbb) {
13
        return document.evaluate(bbb, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
14
    }
15
    setTimeout(function() {
16
        var i = 0;
17
        var a = document.getElementById(i);
18
        while(a != null){
19
            var a = document.getElementById(i);
20
            i++;
21
        };
22
        if($('.choiceButton').text()!="다시 투표하기"){
23
            var num = Math.floor(Math.random() * i);
24
            document.getElementById(num).click();
25
            aaa("//html/body/div[2]/div/div[1]/div[2]/div[2]/button").click();
26
            window.close();
27
        }else{
28
            window.close();
29
        }
30
    }, 200)
31
})();