<- PySnipp ->
Monday, January 31, 2005
 
tinyRSS.py

#!/usr/bin/env python
#a very simple and tiny RSS0.91 reader, uses no RegEx
from urllib import urlopen
rssfeed = "http://osdir.com/backend.php"
data = urlopen(rssfeed).read( ).split('<item>')
feeds = [ ]
for item in range(15):
feeds.append([])
try:
tag = data[item][:data[item].index('\n</item>')].split('\n')
feeds[item].append(tag[1].strip('</title>'))
feeds[item].append(tag[2].strip('</link>').replace('&amp;', '&'))
except:
pass
for i in feeds:
if len(i) > 0:
print '<a href="%s">%s</a>' % (i[1], i[0])


PicoSearch
  Help
Site Search by PicoSearch

Powered by Blogger Listed on Blogwise Subscribe with Bloglines


Get Firefox! Get Thunderbird! Creative Commons Licensed Open Source Licensed

No e patents

Get OpenOffice