Skip to content

Auto monitor air condition, with SMS notification.

License

Notifications You must be signed in to change notification settings

KailinLi/Air-Monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

空气质量监测

每天固定时间自动获取目标地的空气质量指数,如果超过150为中度污染,触发短信提醒

使用说明

通过mob.com获取实时的空气质量指数,判断后使用阿里大于进行短信发送。

其中阿里大于使用@0x5010修改后的短信接口

可直接用pip安装。

sudo pip install six
pip install alidayu

定时功能可使用crontab,在macOS和Linux上测试可行,定时配置文件举例:

30 7,11,17,21 * * * python /root/AirMonitor.py >/dev/null 2>&1

具体使用请查询:

man crontab

此处有小坑:请注意VPS上的系统时区,自行换算或者修改区时。

编写细节

  • 用两个小时,从python零基础现学的,肯定有不少naive的用法,还请指正。
  • 代码未做多少封装,只是一个参考交流的目的。
  • 以后一定会继续扩展功能,比如快递查询 天气预报等等。

运行效果

Demo

About

Auto monitor air condition, with SMS notification.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages