// ==UserScript== // @name 91wii 自动签到 // @version 0.7 // @description 91wii 登录之后,自动签到。 // @author hankaibo // @match *://www.91wii.com/* // @run-at document-end // @namespace http://tampermonkey.net/ // @grant GM_setValue // @grant GM_getValue // @downloadURL none // ==/UserScript== (function () { 'use strict'; // Your code here... var today=new Date().toLocaleDateString('zh-CN').replaceAll('/','-'); registerMenuCommand(); // 注册脚本菜单 function registerMenuCommand() { checkLogin(); autoSignIn(); } // 检查是否登陆 var isLogin = false; checkLogin(); // 判断是否登陆 function checkLogin() { var checkLogin = document.querySelector('#dcsignin_tips'); if (checkLogin) { isLogin = true; } } // 自动签到 function autoSignIn() { var isSignIn= GM_getValue(today,false); if (isLogin && isSignIn) { // 签到 document.querySelector('#dcsignin_tips').click(); // 选择心情,填写内容,提交 setTimeout(function () { document.querySelector('.dcsignin_list li').click(); document.querySelector('#content').value = "记上一笔,hold住我的快乐!"; document.querySelector('#signform button[name="signpn"]').click(); GM_setValue(today, true); }, 1000); } } })();