2010 1.09
Revision as of 22:13, 6 December 2010 by Michael Murtaugh (talk | contribs) (Created page with "== Read a feed with a URL from the command line == <source lang="python"> #!/usr/bin/env python import sys, feedparser try: url = sys.argv[1] except IndexError: url = "...")
Read a feed with a URL from the command line
#!/usr/bin/env python
import sys, feedparser
try:
url = sys.argv[1]
except IndexError:
url = "http://feeds.bbci.co.uk/news/rss.xml"
feed = feedparser.parse(url)
for e in feed.entries:
print e.title.encode("utf-8")