Code Monkey home page Code Monkey logo

mogudingrobot's Introduction

蘑菇丁App自动签到

蘑菇丁App自动签到解决方案:

  • serverless,可以使用腾讯云、阿里云等平台提供的函数计算服务,并且免费额度足够签到使用。代码文件在仓库serverless目录下。
  • 将程序设置成工作电脑的开机自启项,每天开机时即自动签到。代码文件在仓库pc目录下。
  • 将以上两种方案进行综合,工作日电脑自启签到方式+周末函数计算签到方式。
  • server。如果你自己有云服务器,可以设置定时任务,仓库server目录和pc目录下代码文件都可以用,区别是server版本代码可以设置随机签到时间(I am not a robot! :) ),pc版本是立即签到。

使用

选择上述解决方案之一,去对应的目录下载代码文件修改配置信息,目前只提供了python版。

将代码里的配置信息修改成自己的信息:

#配置信息
phone = ""    # 登录手机号
password = ""  # 登录密码
desc = "我在这里"   #签到文本
longitude = "116.404267"  #经度
latitude = "39.910131"   #纬度
address = "***广场"   #签到地点名
stateType = "START"  #START 上班 END 下班
sec = 890  # 延迟签到的上限时间,单位为秒,pc方式无需关心此变量
#配置信息

server和serverless方式代码中引入了sched模块是为了在定时任务执行函数后可以延迟随机数时间再进行签到,打破规律性(我不是机器人:)),PC方式里去掉了该模块。 image

server

安装python环境和设置定时任务这里不赘诉,代码配置信息里修改sec,这个数值是随机延迟签到的上限时间,单位为秒。即 假设定时任务执行时间为7:00,sec设为900(s),签到时间会随机在7:00-7:15区间内。

serverless

这里以腾讯云函数计算服务举例,代码文件在阿里云同样可用。

修改代码配置信息sec,这个数值是随机延迟签到的上限时间,单位是秒,设置在0-890范围之间(腾讯云函数免费额度,其他平台可能不同)。

  1. 创建函数。在函数服务控制台新建函数时运行环境选择python 3.6,在提交方法选在线编辑后完成创建。在函数代码页面的编辑器里新建文件名为"index.py",将本仓库的代码复制进去,设置执行方法为index.main_handler后保存即完成函数计算的部署。 image

  2. 设置定时触发器。保存并测试成功后,添加触发方式为定时触发,自定义触发周期的Cron表达式,比如 0 30 7 * * * * , 意思是每天7点30分触发;每个周末中午12点触发的Cron表达式为0 0 12 * * SAT,SUN *,Cron表达式详细用法请参考各平台的官方文档。 image

  3. I am not a robot! 在函数配置页面修改超时时间为免费额度最大值900秒(初始默认为3秒),所以配置信息中的sec需要设置在0-890范围之间,即可实现如定时触发时间为每天7:00,则签到时间随机落在7:00~7:15区间内。 image

腾讯云函数计算文档:https://cloud.tencent.com/document/product/583

阿里云函数计算文档:https://help.aliyun.com/product/50980.html?spm=a2c4g.11174283.6.540.24995212EDY4iS

PC (Windows)

Python

  1. 安装python3 环境 (https://python.org) 和 requests库(pip install requests) 。

  2. 下载仓库中的mogudStart.bat文件(用来运行脚本),修改其中代码文件的路径

  3. mogudStart.bat文件放到C:\Users\用户名\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup 目录下,重启。

其他系统

Bing

mogudingrobot's People

Contributors

grisse avatar lucky-zwx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mogudingrobot's Issues

关于延时的问题

在腾讯云中,sec设置为0,正常使用;
设置为其他值,报错{"errorCode":-1,"errorMessage":"Task timed out after 3 seconds"}

感谢

万分感谢作者的开源

无法签到

为啥我在服务器上运行只出现xx秒后签到,然后时间到了没有反应,去app看也没有签到

部署腾讯云函数后测试报错

相关日志

START RequestId: d2ee8a95-3182-44dc-ae2c-b2830ee3318a

Init Report RequestId: d2ee8a95-3182-44dc-ae2c-b2830ee3318a Coldstart: 772ms (PullCode: 111ms InitRuntime: 231ms InitFunction: 430ms) Memory: 512MB MemUsage: 16.24MB

延迟27秒签到

Starting new HTTPS connection (1): api.moguding.net:9000

https://api.moguding.net:9000 "POST /session/user/v1/login HTTP/1.1" 200 None

Starting new HTTPS connection (1): api.moguding.net:9000

https://api.moguding.net:9000 "POST /practice/plan/v1/getPlanByStu HTTP/1.1" 200 None

ERROR RequestId:d2ee8a95-3182-44dc-ae2c-b2830ee3318a Result:{"errorCode":1,"errorMessage":"user code exception caught","stackTrace":"Traceback (most recent call last):\n File "/var/user/index.py", line 75, in main_handler\n schedule.run()\n File "/var/lang/python3/lib/python3.6/sched.py", line 154, in run\n action(*argument, **kwargs)\n File "/var/user/index.py", line 60, in main\n 'planId': getPlanId(headers),\n File "/var/user/index.py", line 41, in getPlanId\n return resp['data'][0]['planId']\nKeyError: 'data'","statusCode":430}

END RequestId:d2ee8a95-3182-44dc-ae2c-b2830ee3318a

Report RequestId:d2ee8a95-3182-44dc-ae2c-b2830ee3318a Duration:27915ms Memory:512MB MemUsage:16.886719MB

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.