def parseDocument(self,document,limit=None): root = document.getElementByTagName("feed") if root.tagName == None: return None feed = Feed() feed.title = root.tagValue("title") feed.url = root.getElementWithAttribute("link","rel","alternate").getAttribute("href") feed.entries = self.parseEntries(document.getElementsByTagName("entry"),limit,feed) return feed
def parseDocument(self,document,limit=None): root = document.getElementByTagName("rss").getElementByTagName("channel") if root.tagName == None: return None feed = Feed() feed.title = root.tagValue("title") feed.url = root.tagValue("link") feed.entries = self.parseEntries(document.getElementsByTagName("item"),limit,feed) return feed