这是我用py写的在mac os系统下检查今日是否在github上提交过代码的脚本
其实是每天都有在写代码的,只是经常性的就忘记来github
上提交记录一下,久而久之,首页上的记录一片惨灰。
我可不想这样!我是很勤奋的程序员!
于是就有了这个,可以提示我今天是否提交过代码,可以提醒我去提交,如果已经提交过,还可以自己给自己一个萌萌哒的鼓励!。
其实内部实现是比较粗糙的,就比如说timeout
的情况也没能好好处理。
这个是主要用在mac os
系统下的,每天的定时是使用了launchctl
实现,而弹窗提醒是直接调用了apple script
。
说白了其实就是:
- 使用
requests
给我的个人首页发请求,得到http
返回的body
之后,解析一下当日的rect
的data-count
是否为0
; - 使用
launchctl
定时在每天的20:00
和22:30
自动运行代码。
- 你可以参照我的思路制作更加精致的py脚本
- 使用
mac os
的小伙伴记得使用launchctl
而不是cron
哦~,使用windows
的小伙伴肯定有其他很多的办法的吧! - 还可以为自己的弹框提示加声音!
感谢。