利用PyWapFetion發免費天氣短信

用到的第三方資源:python

個人代碼forecast.py只有幾行:git

1 #!/usr/bin/python
2 #-*-coding:utf-8 -*-
3 import PyWapFetion 4 import feedparser 5 weather_source = "http://weather.raychou.com/?/detail/57494/rss"
6 d=feedparser.parse(weather_source) 7 send_content = d.feed.title + "\n明天:" + d.entries[1].description + "\n後天:" +  d.entries[2].description 8 print send_content 9 PyWapFetion.send("15171456221","mypasswd","15171456221",send_content)

若是要天天定時發送,那麼就將這個腳本使用Linux的計劃任務Crontab定時執行。 github

相關文章
相關標籤/搜索