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

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-07-30 12:49:41 UTC
  • mfrom: (1.3.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090730124941-qjdsmri25zt8zocn
Tags: 0.6.3+dfsg-0ubuntu1
* New upstream release. Please see http://calibre.kovidgoyal.net/new_in_6/
  for the list of new features and changes.
* remove_postinstall.patch: Update for new version.
* build_debug.patch: Does not apply any more, disable for now. Might not be
  necessary any more.
* debian/copyright: Fix reference to versionless GPL.
* debian/rules: Drop obsolete dh_desktop call.
* debian/rules: Add workaround for weird Python 2.6 setuptools behaviour of
  putting compiled .so files into src/calibre/plugins/calibre/plugins
  instead of src/calibre/plugins.
* debian/rules: Drop hal fdi moving, new upstream version does not use hal
  any more. Drop hal dependency, too.
* debian/rules: Install udev rules into /lib/udev/rules.d.
* Add debian/calibre.preinst: Remove unmodified
  /etc/udev/rules.d/95-calibre.rules on upgrade.
* debian/control: Bump Python dependencies to 2.6, since upstream needs
  it now.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
'''
2
 
        Profile to download Jutarnji.hr
3
 
'''
4
 
 
5
 
import re
6
 
        
7
 
from calibre.ebooks.lrf.web.profiles import DefaultProfile 
8
 
 
9
 
class NewYorker(DefaultProfile):
10
 
        
11
 
        title = 'The New Yorker'
12
 
        max_recursions = 2
13
 
        timefmt  = ' [%d %b %Y]'
14
 
        max_articles_per_feed = 20
15
 
        html_description = True
16
 
        no_stylesheets = True
17
 
        oldest_article = 14
18
 
        
19
 
        
20
 
        ## Getting the print version 
21
 
        def print_version(self, url):
22
 
                return url + '?printable=true'
23
 
 
24
 
 
25
 
        preprocess_regexps = [
26
 
                (re.compile(r'<body.*?<!-- start article content -->', re.IGNORECASE | re.DOTALL), lambda match : '<body>'),
27
 
                (re.compile(r'<div class="utils"'), 
28
 
                 lambda match : '<div class="utils" style="display:none"'),
29
 
                (re.compile(r'<div class="articleRailLinks"'), 
30
 
                 lambda match : '<div class="articleRailLinks" style="display:none"'),
31
 
                (re.compile(r'<div id="keywords"'), 
32
 
                 lambda match : '<div id="keywords" style="display:none"'), 
33
 
                (re.compile(r'<!-- end article body -->.*?</body>', re.IGNORECASE | re.DOTALL), lambda match : '</body>'), 
34
 
                (re.compile(r'<!-- start video content -->.*?<!-- end video content -->', re.IGNORECASE | re.DOTALL), lambda match : '<!-- start video content --><!-- end video content -->'), 
35
 
                ]
36
 
        
37
 
                
38
 
        ## Comment out the feeds you don't want retrieved.
39
 
        ## Or add any new new RSS feed URL's here, sorted alphabetically when converted to LRF
40
 
        ## If you want one of these at the top, append a space in front of the name.
41
 
        
42
 
        def get_feeds(self):
43
 
                return  [
44
 
        ('Online Only', 'http://feeds.newyorker.com/services/rss/feeds/online.xml'), 
45
 
        ('The Talk Of The Town', 'http://feeds.newyorker.com/services/rss/feeds/talk.xml'), 
46
 
                ('Reporting and Essays', 'http://feeds.newyorker.com/services/rss/feeds/reporting.xml'), 
47
 
        ('Arts and Culture', 'http://feeds.newyorker.com/services/rss/feeds/arts.xml'), 
48
 
        ('Humor', 'http://feeds.newyorker.com/services/rss/feeds/humor.xml'), 
49
 
        ('Fiction and Poetry', 'http://feeds.newyorker.com/services/rss/feeds/fiction.xml'), 
50
 
                ('Comment', 'http://feeds.newyorker.com/services/rss/feeds/comment.xml'), 
51
 
                ('The Financial Page', 'http://feeds.newyorker.com/services/rss/feeds/financial.xml'), 
52
 
                ('Politics', 'http://feeds.newyorker.com/services/rss/feeds/politics.xml'), 
53
 
                ('Movies', 'http://feeds.newyorker.com/services/rss/feeds/movies.xml'), 
54
 
                ('Books', 'http://feeds.newyorker.com/services/rss/feeds/books.xml'), 
55
 
                ('Tables For Two', 'http://feeds.newyorker.com/services/rss/feeds/tables.xml'), 
56
 
                ]
 
 
b'\\ No newline at end of file'