Created
April 24, 2018 20:37
-
-
Save robintw/650f5635eb9c28ee64c0d3bf8c5309eb to your computer and use it in GitHub Desktop.
Creates a HTML list from an OPML file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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