// ==UserScript== // @name 阿里云开发者社区自动签到 // @namespace https://bbs.tampermonkey.net.cn/ // @version 0.1.0 // @description 首页是https://developer.aliyun.com/mission,登录账号,点击触发即可 // @author You // @match https://developer.aliyun.com/* // ==/UserScript== window.onload = function () { window.setTimeout(function(){ if (isURL1("https://developer.aliyun.com/topic/ffa2023/hands-on/")) { jump('https://developer.aliyun.com/',1); } if (isURL1("https://developer.aliyun.com/")) { jump('https://developer.aliyun.com/iot/',1); } if (isURL1("https://developer.aliyun.com/iot/")) { jump('https://developer.aliyun.com/storage/',1); } if (isURL1("https://developer.aliyun.com/storage/")) { jump('https://developer.aliyun.com/ecs/',1); } if (isURL1("https://developer.aliyun.com/ecs/")) { jump('https://developer.aliyun.com/database/',1); } if (isURL1("https://developer.aliyun.com/database/")) { jump('https://developer.aliyun.com/group/aliyun_linux/',1); } if (isURL1("https://developer.aliyun.com/group/aliyun_linux/")) { jump('https://developer.aliyun.com/group/viapi/',1); } if (isURL1("https://developer.aliyun.com/group/viapi/")) { jump('https://developer.aliyun.com/bigdata/',1); } if (isURL1("https://developer.aliyun.com/bigdata/")) { jump('https://developer.aliyun.com/cloudnative/',1); } if (isURL1("https://developer.aliyun.com/cloudnative/")) { jump('https://developer.aliyun.com/computenest/',1); } if (isURL1("https://developer.aliyun.com/computenest/")) { jump('https://developer.aliyun.com/yitian/',1); } if (isURL1("https://developer.aliyun.com/yitian/")) { jump('https://developer.aliyun.com/group/networking/',1); } if (isURL1("https://developer.aliyun.com/group/networking/")) { jump('https://developer.aliyun.com/group/yunxiao/',1); } if (isURL1("https://developer.aliyun.com/group/yunxiao/")) { jump('https://developer.aliyun.com/polardb/',1); } if (isURL1("https://developer.aliyun.com/polardb/")) { jump('https://developer.aliyun.com/modelscope/',1); } if (isURL1("https://developer.aliyun.com/modelscope/")) { jump('https://developer.aliyun.com/article/1442106/',1); } if (isURL1("https://developer.aliyun.com/article/1442106/")) { jump('https://developer.aliyun.com/score',1); } if (isURL("https://developer.aliyun.com/mission")) { tt(); } if (isURL("https://developer.aliyun.com")) { qd(); } if (isURL("https://developer.aliyun.com/article")) { window.setTimeout(function(){ document.getElementsByClassName('btn-item btn-share')[0].click(); },getRandomInt(3000,6000)); } },getRandomInt(300,800)); }; function createBtn(name){ // 创建一个div元素作为悬浮按钮 var floatingButton = document.createElement("div1"); floatingButton.style.width = "50px"; // 设置按钮宽度 floatingButton.style.height = "30px"; // 设置按钮高度 floatingButton.style.background = "#ff0000"; // 设置背景色(红色) floatingButton.style.borderRadius = "25%"; // 设置边界半径使得按钮变成圆形 floatingButton.style.position = "fixed"; // 设置定位为固定 floatingButton.style.top = "140px"; // 设置与屏幕底部的间距 floatingButton.style.right = "50px"; // 设置与屏幕右侧的间距 // 创建一个span元素来包含按钮的文字 var buttonText = document.createElement("span"); buttonText.textContent = name; // 设置按钮上的文字 buttonText.style.color = "white"; // 设置文字颜色 buttonText.style.fontSize = "16px"; // 设置文字大小 // 将文字添加到按钮中 floatingButton.appendChild(buttonText); // 将按钮添加到文档中 document.body.appendChild(floatingButton); } function tt() { // 创建一个div元素作为悬浮按钮 var floatingButton = document.createElement("div"); floatingButton.style.width = "50px"; // 设置按钮宽度 floatingButton.style.height = "30px"; // 设置按钮高度 floatingButton.style.background = "#ff0000"; // 设置背景色(红色) floatingButton.style.borderRadius = "25%"; // 设置边界半径使得按钮变成圆形 floatingButton.style.position = "fixed"; // 设置定位为固定 floatingButton.style.top = "150px"; // 设置与屏幕底部的间距 floatingButton.style.right = "10px"; // 设置与屏幕右侧的间距 // 创建一个span元素来包含按钮的文字 var buttonText = document.createElement("span"); buttonText.textContent = "触发"; // 设置按钮上的文字 buttonText.style.color = "white"; // 设置文字颜色 buttonText.style.fontSize = "16px"; // 设置文字大小 // 将文字添加到按钮中 floatingButton.appendChild(buttonText); // 点击按钮时触发事件 floatingButton.addEventListener("click", function() { jump('https://developer.aliyun.com/topic/ffa2023/hands-on/',1) }); // 将按钮添加到文档中 document.body.appendChild(floatingButton); } function jump(url1,index){ if(document.getElementsByClassName('aliyun-topbar-element aliyun-logo header-container-left').length==0){ alert("验证") return; } window.setTimeout(function(){ window.open(url1); },getRandomInt(500,1200)); } function qd() { if(document.getElementsByClassName('user-signin-text').length>0 ){ var msg = document.getElementsByClassName('user-signin-text')[0].textContent; if (msg.indexOf("已签到") !=-1 ) { //alert("已签到"); createBtn("已签到"); return; } if (msg.indexOf("已打卡")!=-1 ) { //alert("已打卡"); createBtn("已打卡"); return; } if (msg.indexOf("已抽奖") !=-1 ) { //alert("已抽奖"); createBtn("已抽奖"); return; } } if( document.getElementsByClassName('user-sign-day-box active').length>0){ var msg1 = document.getElementsByClassName('user-sign-day-box active')[0].textContent; if ( msg1.indexOf("已签到") !=-1 ) { //alert("已签到"); createBtn("已签到"); return; } if ( msg1.indexOf("已打卡") !=-1) { //alert("已打卡"); createBtn("已打卡"); return; } if ( msg1.indexOf("已抽奖") !=-1) { //alert("已抽奖"); createBtn("已抽奖"); return; } } window.setTimeout(function(){ document.getElementsByClassName('user-sign-day-box-num')[0].click(); document.getElementsByClassName('unlogin user-sign-day-box active')[0].click(); },getRandomInt(2000,7000)); } function isURL1(x) { return window.location.href==x; } function isURL(x) { return window.location.href.indexOf(x) != -1; } function getRandomInt(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; }