Instantly share code, notes, and snippets.

Embed
What would you like to do?
Creates a HTML list from an OPML file
import dominate
from dominate.tags import h1, ul, li, a
import listparser
parsed = listparser.parse('feedly-11e0b8cd-1b68-422a-bf73-19cb26386252-2018-03-25.opml')
feeds = parsed.feeds
doc = dominate.document(title="Robin's blogroll")
with doc:
h1("Robin's blogroll")
ul(li(a(item.title, href=item.url)) for item in feeds)
with open('blogroll.html', 'w') as f:
f.write(doc.render())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment