粤嵌自动签到

粤嵌自动签到脚本

目前为 2020-04-09 提交的版本。查看 最新版本

// ==UserScript==
// @name         粤嵌自动签到
// @namespace    xiyu
// @version      0.1
// @description  粤嵌自动签到脚本
// @author       xiyu
// @include        *://www.geconline.cn/*
// @include        *://open.talk-fun.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Your code here...
    let main = function() {
     switch(window.location.host) {
        case "www.geconline.cn":
            {
                let reg = /.*\/live_entry/
                let isEntry = reg.test(window.location.pathname)
                if(isEntry) {
                    let go = function() {
                        let a = document.querySelector("body > iframe")
                        if (a) {
                            window.location = a.src
                        }
                    }
                    setInterval(go, 500);
                }
            }
            break;
        case "open.talk-fun.com":
            {
                // in room
                let reg = /room/
                let isRoom = reg.test(window.location.pathname)
                if(isRoom) {
                    var observer = new MutationObserver(function (mutations, observer) {
                        mutations.forEach(item => {
                            let button = item.target.querySelector(".sign_btn > span")
                            if(button) {
                                button.click()
                                console.log("自动签到成功", new Date())
                            }
                        })
                    });
                    observer.observe(document.body, {
                        'childList': true,
                    })
                    console.log("自动签到运行中");
                }
            }
            break;
    }
    }
    window.addEventListener("load", main)
   
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址