~ubuntu-branches/ubuntu/karmic/calibre/karmic

« back to all changes in this revision

Viewing changes to src/calibre/ebooks/lrf/web/profiles/spiegelde.py

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-07-30 12:49:41 UTC
  • mto: This revision was merged to the branch mainline in revision 13.
  • Revision ID: james.westby@ubuntu.com-20090730124941-kviipg9ypwgppulc
Tags: upstream-0.6.3+dfsg
ImportĀ upstreamĀ versionĀ 0.6.3+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
__license__   = 'GPL v3'
2
 
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
3
 
 
4
 
'''
5
 
Fetch Spiegel Online.
6
 
'''
7
 
 
8
 
from calibre.ebooks.lrf.web.profiles import DefaultProfile
9
 
 
10
 
import re
11
 
 
12
 
class SpiegelOnline(DefaultProfile): 
13
 
    
14
 
    title = 'Spiegel Online' 
15
 
    timefmt = ' [ %Y-%m-%d %a]'
16
 
    max_recursions = 2
17
 
    max_articles_per_feed = 40
18
 
    use_pubdate = False
19
 
    no_stylesheets = True
20
 
 
21
 
    preprocess_regexps = \
22
 
        [ (re.compile(i[0], re.IGNORECASE | re.DOTALL), i[1]) for i in 
23
 
            [
24
 
             # Remove Zum Thema footer
25
 
             (r'<div class="spArticleCredit.*?</body>', lambda match: '</body>'),
26
 
             ]
27
 
            ]
28
 
    
29
 
    def get_feeds(self): 
30
 
        return [ ('Spiegel Online', 'http://www.spiegel.de/schlagzeilen/rss/0,5291,,00.xml') ] 
31
 
 
32
 
       
33
 
    def print_version(self,url):
34
 
        tokens = url.split(',')
35
 
        tokens[-2:-2] = ['druck|']
36
 
        return ','.join(tokens).replace('|,','-')