掘金自动签到
// ==UserScript==
// @name 掘金自动签到
// @namespace juejin
// @version 0.1.0
// @description 签到完成再次打开掘金首页
// @author 想用学习脚本请关注微信公众号: 讨生活杂货铺
// @match https://juejin.cn/
// @match https://juejin.cn/user/center/signin?from=main_page
// @require https://scriptcat.org/lib/1167/1.0.0/%E8%84%9A%E6%9C%AC%E7%8C%ABUI%E5%BA%93.js
// ==/UserScript==
//暴露变量 方便调试
(window.unsafeWindow || window).CAT_UI = CAT_UI;
(window.unsafeWindow || window).React = React;
(window.unsafeWindow || window).ReactDOM = ReactDOM;
(window.unsafeWindow || window).jsxLoader = jsxLoader;
setTimeout(() => CAT_UI.Message.success("欢迎关注公众号: 讨生活杂货铺"));
(function () {
'use strict';
// Your code here...
setTimeout(() => {
try{
if (document.querySelector("#juejin > div.view-container.container.index-container > main > div > div.timeline-container > div > aside > div.signin-tip.sidebar-block.signin > div > button").innerText !== "已签到") {
document.querySelector("#juejin > div.view-container.container.index-container > main > div > div.timeline-container > div > aside > div.signin-tip.sidebar-block.signin > div > button").click();
}}catch(err){
console.log('另一个页面')
}
if (window.location.href == "https://juejin.cn/user/center/signin?from=main_page") {
setTimeout(() => {
document.querySelector("#juejin > div.view-container > main > div.right-wrap > div > div:nth-child(1) > div.signin > div.content-body > div.content-right > div.code-calender > button").click();
setTimeout(() => {
document.querySelector(".btn-area button").click();
setTimeout(() => {
document.querySelector("#turntable-item-0").click();
setTimeout(() => {
window.location.href = 'https://juejin.cn'
}, 1 * 1000)
}, 2 * 1000)
}, 2* 1000)
// window.location.href = 'https://juejin.cn'
}, 3000)
}
}, 3000)
})();