1、进入金山文档网页版 https://www.kdocs.cn/ 2、随便新建一个空表格,点击【效率】-【高级开发】-【airScript脚本编辑器】 3、点击【创建脚本】-【文档共享脚本】 4、创建成功后随便命名,我这里命名为:阿里
var myDate = new Date();var data_time = myDate.toLocaleDateString()function sleep(d){ for(var t = Date.now();Date.now() - t <= d;);}var value= ""for (let ii = 2; ii <= 20; ii++){ dyg = "A"+ii var refresh_token = Application.Range(dyg).Text if(refresh_token != ""){ // 发起网络请求-获取token let data = Http.post("https://auth.aliyundrive.com/v2/account/token", JSON.stringify({ "grant_type": "refresh_token", "refresh_token":refresh_token }) ) data = data.json() var access_token = data['access_token'] var phone = data["user_name"] if (access_token == undefined){ var value ="单元格【"+dyg+"】内的token值错误,程序执行失败,请重新复制正确的token值"+"\n" }else{ try{ var access_token2 = 'Bearer '+access_token // 签到 let data2 = HTTP.post("https://member.aliyundrive.com/v1/activity/sign_in_list", JSON.stringify({"_rx-s": "mobile"}), {headers:{"Authorization":access_token2}} ) data2=data2.json() var signin_count = data2['result']['signInCount'] var value =value+ "账号:"+data["user_name"]+"-签到成功, 本月累计签到"+ signin_count+"天"+"\n" }catch{ var value ="单元格【"+dyg+"】内的token签到失败"+"\n" return } sleep(1000) var sflq = Application.Range("B"+ii).Text if (sflq == "是"){ try{ // 领取奖励 let data3 = HTTP.post( "https://member.aliyundrive.com/v1/activity/sign_in_reward?_rx-s=mobile", JSON.stringify({"signInDay": signin_count}), {headers:{"Authorization":access_token2}} ) data3=data3.json() var value = value +"本次签到获得"+data3["result"]["name"] +","+data3["result"]["description"]+"\n" }catch{ var value = value+ "账号:"+data["user_name"]+"-领取奖励失败"+"\n" } }else{ value = value +"奖励待领取"+"\n" } } }}var sftz = Application.Range("E"+1).Textif (sftz=="是"){ var jsyx = Application.Range("E"+2).Text // 配置发送邮箱 let mailer = SMTP.login({ host: "smtp.163.com", // 邮箱 的SMTP服务器的域名 port: 465, username: "fs8484848@163.com", // 邮箱地址 passWord: "QADSEMPKDHDAVWVD", // 邮箱的SMTP密码,非密码 secure: true}); mailer.send({ from: "阿里云盘签到", // 发件人 to: jsyx, // 收件人 subject: "阿里云盘签到通知-"+data_time, // 主题 text: value, // 文本 })}else{ console.log(value)}
--结束END--
本文标题: 【阿里云盘】自动每日签到,无需部署,无需服务器
本文链接: https://lsjlt.com/news/374068.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0