def feed(url, delay=1, cached=False, headers={'User-Agent': 'Grasp.py'}):
s = download(url, headers=headers, delay=delay, cached=cached)
for f in (rss, atom):
try:
for r in f(s):
yield r
except ElementTree.ParseError as e: # HTML?
pass
except:
pass
# for story in feed('http://feeds.washingtonpost.com/rss/world'):
# print(story)
#---- MAIL ----------------------------------------------------------------------------------------
# The mail() function sends a HTML-formatted e-mail from a Gmail account.
评论列表
文章目录