您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
早上8点后打开任意网页即可自动当日签到
当前为
// ==UserScript== // @name 掌上书苑自动签到 // @description 早上8点后打开任意网页即可自动当日签到 // @include * // @version 1.0 // @author yechenyin // @namespace http://greasyfork.icu/users/3586-yechenyin // @require https://code.jquery.com/jquery-1.11.2.min.js // @grant GM_openInTab // ==/UserScript== if (location.href === 'http://www.cnepub.com/discuz/plugin.php?id=dsu_paulsign:sign') { setTimeout(function () { $('.tac li')[0].click(); $('input[name="qdmode"]')[1].click(); $('.tac a')[0].click(); var date = new Date(); var utc = date.getTime() + date.getTimezoneOffset() * 60000; var china_time = utc + 8 * 3600 * 1000; var china_hour = (new Date(china_time)).getHours(); var china_date = (new Date(china_time)).getDate(); localStorage.signed_date = china_date; console.log(localStorage.signed_date + '日掌上书苑已签到'); }, 0); } else if (location.href === 'http://www.cnepub.com/discuz/member.php?mod=logging&action=login') { if (window.self !== window.top) { GM_openInTab('http://www.cnepub.com/discuz/member.php?mod=logging&action=login', false); } } else { var date = new Date(); var utc = date.getTime() + date.getTimezoneOffset() * 60000; var china_time = utc + 8 * 3600 * 1000; var china_hour = (new Date(china_time)).getHours(); var china_date = (new Date(china_time)).getDate(); //console.log('hour='+china_hour); if (china_hour >= 8 && china_date != localStorage.signed_date) { $('body').append($('<iframe>', {src:'http://www.cnepub.com/discuz/plugin.php?id=dsu_paulsign:sign', css:{display:'none'}})); } }