home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / calibre-0.7.13.msi / file_3766 < prev    next >
Encoding:
Text File  |  2010-01-22  |  3.3 KB  |  68 lines

  1. __license__   = 'GPL v3'
  2. __copyright__ = '2009, Justus Bisser <justus.bisser at gmail.com>'
  3. '''
  4. fr-online.de
  5. '''
  6. import re
  7.  
  8. from calibre.web.feeds.news import BasicNewsRecipe
  9.  
  10. class Spiegel_ger(BasicNewsRecipe):
  11.     title                 = 'Frankfurter Rundschau'
  12.     __author__            = 'Justus Bisser'
  13.     description           = "Dies ist die Online-Ausgabe der Frankfurter Rundschau. Um die abgerufenen individuell einzustellen bearbeiten sie die Liste im erweiterten Modus. Die Feeds findet man auf http://www.fr-online.de/verlagsservice/fr_newsreader/?em_cnt=574255"
  14.     publisher             = 'Druck- und Verlagshaus Frankfurt am Main GmbH'
  15.     category              = 'FR Online, Frankfurter Rundschau, Nachrichten, News,Dienste, RSS, RSS, Feedreader, Newsfeed, iGoogle, Netvibes, Widget'
  16.     oldest_article        = 7
  17.     max_articles_per_feed = 100
  18.     language              = 'de'
  19.     lang                  = 'de-DE'
  20.     no_stylesheets        = True
  21.     use_embedded_content  = False
  22.     #encoding              = 'cp1252'
  23.  
  24.     conversion_options = {
  25.                           'comment'          : description
  26.                         , 'tags'             : category
  27.                         , 'publisher'        : publisher
  28.                         , 'language'         : lang
  29.                         }
  30.  
  31.     recursions = 0
  32.     max_articles_per_feed = 100
  33.     #keep_only_tags = [dict(name='div', attrs={'class':'text'})]
  34.     #tags_remove = [dict(name='div', attrs={'style':'text-align: left; margin: 4px 0px 0px 4px; width: 200px; float: right;'})]
  35.     remove_attributes = ['style']
  36.     feeds = []
  37.     #remove_tags_before = [dict(name='div', attrs={'style':'padding-left: 0px;'})]
  38.     #remove_tags_after = [dict(name='div', attrs={'class':'box_head_text'})]
  39.  
  40.     # enable for all news
  41.     allNews = 0
  42.     if allNews:
  43.         feeds = [(u'Frankfurter Rundschau', u'http://www.fr-online.de/rss/sport/index.xml')]
  44.     else:
  45.         #select the feeds you like
  46.         feeds = [(u'Nachrichten', u'http://www.fr-online.de/rss/politik/index.xml')]
  47.         feeds.append((u'Kommentare und Analysen', u'http://www.fr-online.de/rss/meinung/index.xml'))
  48.         feeds.append((u'Dokumentationen', u'http://www.fr-online.de/rss/dokumentation/index.xml'))
  49.         feeds.append((u'Deutschlandtrend', u'http://www.fr-online.de/rss/deutschlandtrend/index.xml'))
  50.         feeds.append((u'Wirtschaft', u'http://www.fr-online.de/rss/wirtschaft/index.xml'))
  51.         feeds.append((u'Sport', u'http://www.fr-online.de/rss/sport/index.xml'))
  52.         feeds.append((u'Feuilleton', u'http://www.fr-online.de/rss/feuilleton/index.xml'))
  53.         feeds.append((u'Panorama', u'http://www.fr-online.de/rss/panorama/index.xml'))
  54.         feeds.append((u'Rhein Main und Hessen', u'http://www.fr-online.de/rss/hessen/index.xml'))
  55.         feeds.append((u'Fitness und Gesundheit', u'http://www.fr-online.de/rss/fit/index.xml'))
  56.         feeds.append((u'Multimedia', u'http://www.fr-online.de/rss/multimedia/index.xml'))
  57.         feeds.append((u'Wissen und Bildung', u'http://www.fr-online.de/rss/wissen/index.xml'))
  58.  
  59.     def get_article_url(self, article):
  60.         url = article.link
  61.         regex = re.compile("0C[0-9]{6,8}0A?")
  62.  
  63.         liste = regex.findall(url)
  64.         string = liste.pop(0)
  65.         string = string[2:len(string)-1]
  66.         return "http://www.fr-online.de/_em_cms/_globals/print.php?em_cnt=" + string
  67.  
  68.