Thworld的自动签到脚本
git clone [email protected]:codeArvin/thworld_auto_signin.git
npm install
安装依赖包index.js
同目录下新建config.js
文件,格式和config.example.js
一样,添加Thworld的用户名和密码即可node index.js
运行
- 安装依赖包的时候,可能出现问题。
puppeteer
安装时需要翻墙,同时它会下载Chromium
,比较大。具体请查看puppeteer官方文档 - 如果想把程序放到后台运行
- 在Mac的zsh下可用
node index.js > back_log.txt 2>&1 &!
命令来实现,注意命令最后用的是&!
而不是&
,如果用的是&
,当前终端退出后程序就会停止运行,用&!
则终端退出程序也不会停止,但这时要杀死这个程序只能通过ps aux | grep node\ index.js
获取到id
后通过kill id
来实现了。 - 在ubuntu下用
node index.js > back_log.txt 2>&1 &
可以实现ssh退出后程序依旧在运行
- 在Mac的zsh下可用
- 有关后台运行的相关资料
- 在Ubutntu服务器上遇到两个问题
- 缺少依赖,把依赖安装完整就好了,详情查看Failed to launch chrome 和 Troubleshooting
- 由于linux的某个问题导致的bug?详情查看Chrome Headless fails due to sandbox issues