home *** CD-ROM | disk | FTP | other *** search
/ Chip 2011 November / CHIP_2011_11.iso / Programy / Narzedzia / Calibre / calibre-0.8.18.msi / file_280 / twitchfilms.recipe < prev    next >
Text File  |  2011-09-09  |  2KB  |  44 lines

  1. #!/usr/bin/env  python
  2.  
  3. __license__   = 'GPL v3'
  4. __copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
  5. '''
  6. twitchfilm.net/site/
  7. '''
  8. from calibre.web.feeds.news import BasicNewsRecipe
  9. from calibre.ebooks.BeautifulSoup import Tag
  10.  
  11. class Twitchfilm(BasicNewsRecipe):
  12.     title                 = 'Twitch Films'
  13.     __author__            = 'Darko Miletic'
  14.     description           = 'Twitch specializes in spreading the news on strange little films from around the world.'
  15.     oldest_article        = 30
  16.     max_articles_per_feed = 100
  17.     no_stylesheets        = True
  18.     use_embedded_content  = True
  19.     encoding              = 'utf-8'
  20.     publisher             = 'Twitch'
  21.     category              = 'twitch, twitchfilm, movie news, movie reviews, cult cinema, independent cinema, anime, foreign cinema, geek talk'
  22.     language = 'en'
  23.  
  24.     lang                  = 'en-US'
  25.  
  26.     conversion_options = {
  27.                           'comment'          : description
  28.                         , 'tags'             : category
  29.                         , 'publisher'        : publisher
  30.                         , 'language'         : lang
  31.                         , 'pretty_print'     : True
  32.                         }
  33.  
  34.     remove_tags = [dict(name='div', attrs={'class':'feedflare'})]
  35.  
  36.     feeds = [(u'News', u'http://feedproxy.google.com/TwitchEverything')]
  37.  
  38.     def preprocess_html(self, soup):
  39.         mtag = Tag(soup,'meta',[('http-equiv','Content-Type'),('context','text/html; charset=utf-8')])
  40.         soup.head.insert(0,mtag)
  41.         soup.html['lang'] = self.lang
  42.         return self.adeify_images(soup)
  43.  
  44.