// ==UserScript== // @name 掘金自动签到助手 // @namespace ningbnii/monkey_juejin // @version 0.0.6 // @author ningbnii // @description 这个油猴脚本可以自动为您在掘金网站上进行签到,省去了手动签到的烦恼。只需安装脚本,它将为您自动完成每日签到任务。 // @license GPLv3 // @icon https://www.wxbuluo.com/favicon.ico // @match https://juejin.cn/* // @require https://cdn.jsdelivr.net/npm/vue@3.3.4/dist/vue.global.prod.js // @require https://cdn.jsdelivr.net/npm/sweetalert2@11.7.27/dist/sweetalert2.all.min.js // @grant GM_addStyle // @grant GM_getValue // @grant GM_info // @grant GM_registerMenuCommand // @grant GM_setValue // @grant GM_xmlhttpRequest // ==/UserScript== (t=>{if(typeof GM_addStyle=="function"){GM_addStyle(t);return}const e=document.createElement("style");e.textContent=t,document.head.append(e)})(" .read-the-docs{color:#888}.read-the-docs p{font-size:16px;text-align:left;line-height:1.8;letter-spacing:1px}.show-info:hover{cursor:pointer;color:#409eff}.swal2-modal{display:flex!important;flex-direction:column!important}.swal2-modal input{margin:20px auto 0;width:80%!important}.monkey-box[data-v-50faef42]{box-shadow:2px 2px 4px #000;background:#fff;position:fixed;bottom:0;z-index:1000;display:flex;flex-direction:column;max-width:300px;padding:10px} "); (function (vue) { 'use strict'; var M=(()=>typeof GM_getValue<"u"?GM_getValue:void 0)(),x=(()=>typeof GM_info<"u"?GM_info:void 0)(),G=(()=>typeof GM_registerMenuCommand<"u"?GM_registerMenuCommand:void 0)(),C=(()=>typeof GM_setValue<"u"?GM_setValue:void 0)(),S=(()=>typeof GM_xmlhttpRequest<"u"?GM_xmlhttpRequest:void 0)();const k={__name:"HelloWorld",setup(s){let e=vue.ref("");function o(){Swal.fire({title:"使用说明",html:`

登录之后,打开任意掘金网页即可,每天会自动签到

`,showConfirmButton:!0});}const n=new Date().toLocaleDateString();vue.onMounted(()=>{e.value=M("isSignIn"),(!e.value||e.value!==n)&&r(n);}),setInterval(()=>{n!==e.value&&r(n);},18e5);function r(i){S({method:"POST",url:"https://api.juejin.cn/growth_api/v1/check_in",headers:{"content-type":"application","user-agent":navigator.userAgent},responseType:"json",onload:function(t){if(t.status===200){const{err_no:a,err_msg:d}=t.response;if(a===0){const{data:f}=t.response,{sum_point:m,incr_point:v}=f;Swal.fire({title:"签到成功",text:`获得矿石:${v},总矿石:${m}`,icon:"success",timer:2e3});}else Swal.fire({title:"签到失败",text:d,icon:"error",timer:2e3});}else Swal.fire({title:"签到失败",text:"网络错误",icon:"error",timer:2e3});C("isSignIn",i),e.value=i;}});}return (i,t)=>(vue.openBlock(),vue.createElementBlock("span",{class:"show-info",onClick:t[0]||(t[0]=a=>o())},vue.toDisplayString(vue.unref(e)?"已签到:":"未签到")+vue.toDisplayString(vue.unref(e)),1))}};const B=(s,e)=>{const o=s.__vccOpts||s;for(const[n,r]of e)o[n]=r;return o},I={class:"monkey-box"},_="https://greasyfork.org/en/scripts/474736",V={__name:"App",setup(s){G("脚本官网",function(){location.href="https://www.wxbuluo.com";}),e();async function e(){const o=x.script.version;try{const r=await(await fetch(_)).text(),i=/
\s*]*>([\d.]+)<\/span>/,t=r.match(i);t&&t[1]&&o!==t[1]&&(await Swal.fire({title:"脚本有更新",html:`

当前版本:${o}

最新版本:${t[1]}

`,showConfirmButton:!0,showCancelButton:!0,confirmButtonText:"立即更新",cancelButtonText:"稍后更新"})).isConfirmed&&window.open(_,"_blank");}catch(n){console.error("检查更新时出错:",n);}}return (o,n)=>(vue.openBlock(),vue.createElementBlock("div",I,[vue.createVNode(k)]))}},$=B(V,[["__scopeId","data-v-50faef42"]]);vue.createApp($).mount((()=>{const s=document.createElement("div");return document.body.append(s),s})()); })(Vue);