Mercurial > hg > Feedworm
view OpmlImport.py @ 257:75b81da8d7a5
convert the feed entry timestamps to arango compatible date strings in migration
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Tue, 12 Mar 2019 02:38:41 +0100 |
parents | 699d8f1cebd4 |
children |
line wrap: on
line source
# -*- coding: utf-8 -*- from Feed import Feed from xml.dom.minidom import parse def createFeedsFromOPML(session=None, filename=None): document = parse(filename) outlines = document.getElementsByTagName("outline") for outline in outlines: url = outline.getAttribute("xmlUrl") title = outline.getAttribute("title") feed = Feed(title, url) session.add(feed) session.commit()