Пример #1
0
 def _get_entry_summary(self, entry):
     """Gets the summary of an rss entry, unless it is empty, in which case it gets an abbreviated html/content
      excerpt.
     """
     result = self.gets(entry, 'summary', '') #empty summary or no key returns empty string, use stripped html
     if not result:
         html = self._get_entry_html(entry)
         stripped = taoutils.strip_html(html)
         result = stripped
     return result[:300]
Пример #2
0
 def _contentitem_to_postable(self, contentitem):
     """Convert a tweet into a string for posting to twitter."""
     result = taoutils.strip_html(contentitem['html'])
     result = taoutils.decode_html(result)
     return str(result)