def summary(self): """parses the episode's summary from the episode's tvrage page""" try: page = _fetch(self.link).read() if not 'Click here to add a summary' in page: summary = parse_synopsis(page, cleanup='var addthis_config') return summary except Exception, e: print('Episode.summary: %s, %s' % (self, e))
def synopsis(self): """scraps the synopsis from the show's tvrage page using a regular expression. This method might break when the page changes. unfortunatly the episode summary isnt available via one of the xml feeds""" try: page = _fetch(self.link).read() synopsis = parse_synopsis(page) return synopsis except Exception, e: print('Show.synopsis:urlopen: %s, %s' % (self, e))
def recap(self): """parses the episode's recap text from the episode's tvrage recap page""" try: page = _fetch(self.recap_url).read() if not 'Click here to add a recap for' in page: recap = parse_synopsis(page, cleanup='Share this article with your' ' friends') return recap except Exception, e: print('Episode.recap:urlopen: %s, %s' % (self, e))