Skip to content

Instantly share code, notes, and snippets.

@robintw
Created April 24, 2018 20:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robintw/650f5635eb9c28ee64c0d3bf8c5309eb to your computer and use it in GitHub Desktop.
Save robintw/650f5635eb9c28ee64c0d3bf8c5309eb to your computer and use it in GitHub Desktop.
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