home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / calibre-0.7.13.msi / file_3748 < prev    next >
Encoding:
Text File  |  2009-10-14  |  2.0 KB  |  59 lines

  1. #!/usr/bin/env  python
  2.  
  3. __license__   = 'GPL v3'
  4. __copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
  5. '''
  6. exiledonline.com
  7. '''
  8.  
  9. from calibre.web.feeds.news import BasicNewsRecipe
  10.  
  11. class Exiled(BasicNewsRecipe):
  12.     title                 = 'Exiled Online'
  13.     __author__            = 'Darko Miletic'
  14.     description           = "Mankind's only alternative since 1997 - Formerly known as The eXile"
  15.     publisher             = 'Exiled Online'
  16.     category              = 'news, politics, international'
  17.     oldest_article        = 15
  18.     max_articles_per_feed = 100
  19.     no_stylesheets        = True
  20.     use_embedded_content  = False
  21.     encoding              = 'utf8'
  22.     remove_javascript     = True
  23.     language = 'en'
  24.  
  25.     cover_url             = 'http://exiledonline.com/wp-content/themes/exiledonline_theme/images/header-sm.gif'
  26.  
  27.     html2lrf_options = [
  28.                           '--comment'       , description
  29.                         , '--base-font-size', '10'
  30.                         , '--category'      , category
  31.                         , '--publisher'     , publisher
  32.                         ]
  33.  
  34.     html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"'
  35.  
  36.     keep_only_tags = [dict(name='div', attrs={'id':'main'})]
  37.  
  38.     remove_tags = [
  39.                      dict(name=['object','link'])
  40.                     ,dict(name='div', attrs={'class':'info'})
  41.                     ,dict(name='div', attrs={'id':['comments','navig']})
  42.                   ]
  43.  
  44.  
  45.     feeds = [(u'Articles', u'http://exiledonline.com/feed/')]
  46.  
  47.     def preprocess_html(self, soup):
  48.         for item in soup.findAll(style=True):
  49.             del item['style']
  50.         mtag = '\n<meta http-equiv="Content-Language" content="en"/>\n<meta http-equiv="Content-Type" content="text/html; charset=utf-8">\n'
  51.         soup.head.insert(0,mtag)
  52.         return soup
  53.  
  54.     def get_article_url(self, article):
  55.         raw = article.get('link',  None)
  56.         final = raw + 'all/1/'
  57.         return final
  58.  
  59.