Tuesday, May 27, 2008

Processing RSS feeds --the Python way

[shantanu@myjunkyard rss]$ cat a1.py
#!/usr/bin/env python
import feedparser
import sys
d = feedparser.parse(sys.argv[1])
for i in d['entries']:
for j in i['links']:
print i['title'] + "######" + j['href']


[shantanu@myjunkyard rss]$ cat rssFeed.list
http://puretechie.blogspot.com/atom.xml

[shantanu@myjunkyard rss]$ for i in `cat rssFeed.list `; do ./a1.py $i; done

See it Yourself :)

No comments: