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

« back to all changes in this revision

Viewing changes to src/calibre/ebooks/lrf/web/profiles/jutarnji.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 by Valloric
3
 
'''
4
 
 
5
 
import re
6
 
        
7
 
from calibre.ebooks.lrf.web.profiles import DefaultProfile 
8
 
 
9
 
class Jutarnji(DefaultProfile):
10
 
 
11
 
        title = 'Jutarnji'
12
 
        max_recursions = 2
13
 
        timefmt  = ' [%d %b %Y]'
14
 
        max_articles_per_feed = 80
15
 
        html_description = True
16
 
        no_stylesheets = True
17
 
 
18
 
        preprocess_regexps = [
19
 
                (re.compile(r'<body.*?<span class="vijestnaslov">', re.IGNORECASE | re.DOTALL), lambda match : '<body><span class="vijestnaslov">'), 
20
 
                (re.compile(r'</div>.*?</td>', re.IGNORECASE | re.DOTALL), lambda match : '</div></td>'), 
21
 
                (re.compile(r'<a name="addComment.*?</body>', re.IGNORECASE | re.DOTALL), lambda match : '</body>'), 
22
 
                (re.compile(r'<br>', re.IGNORECASE | re.DOTALL), lambda match : ''), 
23
 
                ]
24
 
        
25
 
        ## Getting the print version 
26
 
        
27
 
        def print_version(self, url):
28
 
                return 'http://www.jutarnji.hr/ispis_clanka.jl?artid=' + url[len(url)-9:len(url)-3]
29
 
 
30
 
        
31
 
        ## Comment out the feeds you don't want retrieved.
32
 
        ## Or add any new new RSS feed URL's here, sorted alphabetically when converted to LRF
33
 
        ## If you want one of these at the top, append a space in front of the name.
34
 
        
35
 
        def get_feeds(self):
36
 
                return  [
37
 
                (' Naslovnica', 'http://www.jutarnji.hr/rss'), 
38
 
                ('Sport', 'http://www.jutarnji.hr/sport/rss'), 
39
 
                ('Novac', 'http://www.jutarnji.hr/novac/rss'), 
40
 
                ('Kultura i zivot', 'http://www.jutarnji.hr/kultura_i_zivot/rss'), 
41
 
                ('Automoto', 'http://www.jutarnji.hr/auto_moto/rss'), 
42
 
                ('Hi-Tech', 'http://www.jutarnji.hr/kultura_i_zivot/hi-tech/rss'), 
43
 
                ('Dom i nekretnine', 'http://www.jutarnji.hr/nekretnine/rss'), 
44
 
                ]
 
 
b'\\ No newline at end of file'