home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / calibre-0.7.13.msi / file_3832 < prev    next >
Encoding:
Text File  |  2010-03-27  |  1.8 KB  |  46 lines

  1. __license__   = 'GPL v3'
  2. __copyright__ = "2008, Derry FitzGerald. 2009 Modified by Ray Kinsella and David O'Callaghan"
  3. '''
  4. irishtimes.com
  5. '''
  6. import re
  7.  
  8. from calibre.web.feeds.news import BasicNewsRecipe
  9.  
  10. class IrishTimes(BasicNewsRecipe):
  11.     title          = u'The Irish Times'
  12.     __author__     = "Derry FitzGerald, Ray Kinsella and David O'Callaghan"
  13.     language = 'en_IE'
  14.     timefmt = ' (%A, %B %d, %Y)'
  15.  
  16.  
  17.     oldest_article = 3
  18.     no_stylesheets = True
  19.     simultaneous_downloads= 1
  20.  
  21.     r = re.compile('.*(?P<url>http:\/\/(www.irishtimes.com)|(rss.feedsportal.com\/c)\/.*\.html?).*')
  22.     remove_tags    = [dict(name='div', attrs={'class':'footer'})]
  23.     extra_css      = '.headline {font-size: x-large;} \n .fact { padding-top: 10pt  }'
  24.  
  25.     feeds          = [
  26.                       ('Frontpage', 'http://www.irishtimes.com/feeds/rss/newspaper/index.rss'),
  27.                       ('Ireland', 'http://www.irishtimes.com/feeds/rss/newspaper/ireland.rss'),
  28.                       ('World', 'http://www.irishtimes.com/feeds/rss/newspaper/world.rss'),
  29.                       ('Finance', 'http://www.irishtimes.com/feeds/rss/newspaper/finance.rss'),
  30.                       ('Features', 'http://www.irishtimes.com/feeds/rss/newspaper/features.rss'),
  31.                       ('Sport', 'http://www.irishtimes.com/feeds/rss/newspaper/sport.rss'),
  32.                       ('Opinion', 'http://www.irishtimes.com/feeds/rss/newspaper/opinion.rss'),
  33.                       ('Letters', 'http://www.irishtimes.com/feeds/rss/newspaper/letters.rss'),
  34.                     ]
  35.  
  36.  
  37.     def print_version(self, url):
  38.         if url.count('rss.feedsportal.com'):
  39.             u = url.replace('0Bhtml/story01.htm','_pf0Bhtml/story01.htm')
  40.         else:
  41.             u = url.replace('.html','_pf.html')
  42.         return u
  43.  
  44.     def get_article_url(self, article):
  45.         return article.link
  46.