Example #1
0
 def parse_entry(self, entry):
     text = entry.find(class_='Text').text.replace('\r\n', '<br/>')
     if len(text) > self.MAX_LENGTH:
         return None
     pasty = Pasty()
     pasty.text = text
     pasty.date = to_date(entry.find(class_='date').text)
     pasty.published = True
     pasty.source = self.source.url
     return pasty
Example #2
0
 def parse_entry(self, entry):
     text = self.process_text(entry['summary_detail']['value'])
     if len(text) > self.MAX_LENGTH or \
             not remove_html_tags(text):
         return None
     pasty = Pasty()
     pasty.text = text
     pasty.date = to_date(entry['published_parsed']) or self.last_update
     pasty.published = True
     pasty.source = self.source.url
     return pasty