Created
June 29, 2011 14:47
-
-
Save liruqi/1053983 to your computer and use it in GitHub Desktop.
检查韩寒博客,如果有同月同日发博文,则会发送一个桌面提醒~
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# author: liruqi@gmail.com (http://liruqi.wordpress.com/) | |
# require feedparser: http://www.feedparser.org/ | |
# | |
import time | |
import os | |
import feedparser | |
f = feedparser.parse("http://blog.sina.com.cn/rss/1191258123.xml") | |
for e in f.entries: | |
now = time.localtime() | |
if e.updated_parsed.tm_mon == now.tm_mon: | |
print e.links[0]["href"] | |
print e.updated | |
if e.updated_parsed.tm_mday == now.tm_mday: | |
notify = 'notify-send -t 2000 -i ~/Desktop/logo-mongodb.png "%s" "%s"'%(e.links[0]["href"], e.links[0]["href"]) | |
os.system(notify) | |
print e.links[0]["href"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment