def get_title(self): title = util.getNodeText( self.item.getElementsByTagName('title')[0].childNodes) if title.find('CDATA') > -1 or title.strip() == '': title = util.getCData(self.item.getElementsByTagName('title') [0]) # village voice, style peterson return title.strip()
def get_description(self, tag='description'): desc = '' if len(self.item.getElementsByTagName(tag)) > 0: desc = util.getNodeText(self.item.getElementsByTagName(tag)[0].childNodes) if desc == None or desc.strip() == '' or desc.find('CDATA') > -1: desc = util.getCData(self.item.getElementsByTagName(tag)[0]) if desc == None or desc.strip() == '': if len(self.item.getElementsByTagName('content')) > 0: desc = util.getNodeText(self.item.getElementsByTagName('content')[0].childNodes) if desc == None or desc.strip() == '' or desc.find('CDATA') > -1: desc = util.getCData(self.item.getElementsByTagName('content')[0]) if desc == None or desc.strip() == '': if len(self.item.getElementsByTagName('summary')) > 0: desc = util.getNodeText(self.item.getElementsByTagName('summary')[0].childNodes) return desc.strip()
def get_creator(self, tag='dc:creator'): creator = '' if len(self.item.getElementsByTagName(tag)) > 0: creator = util.getNodeText(self.item.getElementsByTagName(tag)[0].childNodes) if creator == None or creator.strip() == '': creator = util.getCData(self.item.getElementsByTagName(tag)[0]) if creator == None or creator.strip() == '': if len(self.item.getElementsByTagName('author')) > 0 and len(self.item.getElementsByTagName('author')[0].getElementsByTagName('name')) > 0: creator = util.getNodeText(self.item.getElementsByTagName('author')[0].getElementsByTagName('name')[0].childNodes) return creator.strip()
def get_description(self, tag='description'): desc = '' if len(self.item.getElementsByTagName(tag)) > 0: desc = util.getNodeText( self.item.getElementsByTagName(tag)[0].childNodes) if desc == None or desc.strip() == '' or desc.find('CDATA') > -1: desc = util.getCData(self.item.getElementsByTagName(tag)[0]) if desc == None or desc.strip() == '': if len(self.item.getElementsByTagName('content')) > 0: desc = util.getNodeText( self.item.getElementsByTagName('content')[0].childNodes) if desc == None or desc.strip( ) == '' or desc.find('CDATA') > -1: desc = util.getCData( self.item.getElementsByTagName('content')[0]) if desc == None or desc.strip() == '': if len(self.item.getElementsByTagName('summary')) > 0: desc = util.getNodeText( self.item.getElementsByTagName('summary')[0].childNodes) return desc.strip()
def get_creator(self, tag='dc:creator'): creator = '' if len(self.item.getElementsByTagName(tag)) > 0: creator = util.getNodeText( self.item.getElementsByTagName(tag)[0].childNodes) if creator == None or creator.strip() == '': creator = util.getCData(self.item.getElementsByTagName(tag)[0]) if creator == None or creator.strip() == '': if len(self.item.getElementsByTagName('author')) > 0 and len( self.item.getElementsByTagName('author') [0].getElementsByTagName('name')) > 0: creator = util.getNodeText( self.item.getElementsByTagName('author') [0].getElementsByTagName('name')[0].childNodes) return creator.strip()
def get_title(self): title = util.getNodeText(self.item.getElementsByTagName('title')[0].childNodes) if title.find('CDATA') > -1 or title.strip() == '': title = util.getCData(self.item.getElementsByTagName('title')[0]) # village voice, style peterson return title.strip()
def get_description(self): if len(self.item.getElementsByTagName('description')) > 0: desc = util.getCData(self.item.getElementsByTagName('description')[0]) self.orig_desc = desc return desc[desc.find('-')+1:].strip() return ''