Skip to content

Instantly share code, notes, and snippets.

@okaram
Created November 16, 2012 01:27
Show Gist options
  • Save okaram/4083086 to your computer and use it in GitHub Desktop.
Save okaram/4083086 to your computer and use it in GitHub Desktop.
Python Blogroll
import feedparser
f=open('blogroll.html','w')
f.write("<html>\n<head>\n<title>Blogroll</title>\n</head>\n<body>");
blogs=["http://programminggenin.blogspot.com/feeds/posts/default","http://djangolearner.blogspot.com/feeds/posts/default"];
for blog in blogs :
feed=feedparser.parse(blog)
f.write('<a href="%s">%s</a>\n'% (feed.feed.link,feed.feed.title));
f.write('<ul>\n');
for e in feed.entries:
f.write( ' <li><a href="%s">%s</a></li>\n'% (e.link,e.title) )
f.write('</ul>\n');
f.write('</body>\n</html>');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment