5
""" create a list of rss data """
7
__copyright__ = 'this file is in the public domain'
9
from gozerbot.generic import handle_exception
10
import xml.dom.minidom
12
def gettext(nodelist):
13
""" get text data from nodelist """
16
if node.nodeType == node.TEXT_NODE or node.nodeType == \
17
node.CDATA_SECTION_NODE:
18
stripped = node.data.strip()
23
def makersslist(xlist, nodes , d={}):
24
""" recurse until txt is found """
26
if i.nodeType == i.ELEMENT_NODE:
27
dd = d[i.nodeName] = {}
28
makersslist(xlist, i.childNodes, dd)
31
txt = gettext(i.childNodes)
36
""" create list of dictionaries with rss data """
37
dom = xml.dom.minidom.parseString(txt)
39
makersslist(result, dom.childNodes)