~stub/ubuntu/precise/calibre/devel

« back to all changes in this revision

Viewing changes to resources/recipes/publika.recipe

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-04-12 11:29:25 UTC
  • mfrom: (42.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20110412112925-c7171kt2bb5rmft4
Tags: 0.7.50+dfsg-2
* debian/control: Build with libpodofo-dev to enable PDF metadata.
  (Closes: #619632)
* debian/control: Add libboost1.42-dev build dependency. Apparently it is
  needed in some setups. (Closes: #619807)
* debian/rules: Call dh_sip to generate a proper sip API dependency, to
  prevent crashes like #616372 for partial upgrades.
* debian/control: Bump python-qt4 dependency to >= 4.8.3-2, which reportedly
  fixes crashes on startup. (Closes: #619701, #620125)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- coding: utf-8 -*-
 
2
#!/usr/bin/env  python
 
3
 
 
4
__license__   = 'GPL v3'
 
5
__copyright__ = u'2011, Silviu Cotoar\u0103'
 
6
'''
 
7
publika.md
 
8
'''
 
9
 
 
10
from calibre.web.feeds.news import BasicNewsRecipe
 
11
 
 
12
class Publika(BasicNewsRecipe):
 
13
    title                 = u'Publika'
 
14
    __author__            = u'Silviu Cotoar\u0103'
 
15
    description           = u'\u015etiri din Moldova'
 
16
    publisher             = u'Publika'
 
17
    oldest_article        = 25
 
18
    language              = 'ro'
 
19
    max_articles_per_feed = 100
 
20
    no_stylesheets        = True
 
21
    use_embedded_content  = False
 
22
    category              = 'Ziare,Stiri,Moldova'
 
23
    encoding              = 'utf-8'
 
24
    cover_url             = 'http://assets.publika.md/images/logo.jpg'
 
25
 
 
26
    conversion_options = {
 
27
                             'comments'   : description
 
28
                            ,'tags'       : category
 
29
                            ,'language'   : language
 
30
                            ,'publisher'  : publisher
 
31
                         }
 
32
 
 
33
    keep_only_tags = [
 
34
                          dict(name='div', attrs={'id':'colLeft'})
 
35
                     ]
 
36
 
 
37
    remove_tags = [
 
38
                          dict(name='div', attrs={'class':['articleInfo']})
 
39
                        , dict(name='div', attrs={'class':['articleRelated']})
 
40
                        , dict(name='div', attrs={'class':['roundedBox socialSharing']})
 
41
                        , dict(name='div', attrs={'class':['comment clearfix']})
 
42
                  ]
 
43
 
 
44
    remove_tags_after = [
 
45
                              dict(name='div', attrs={'class':['roundedBox socialSharing']})
 
46
                            , dict(name='div', attrs={'class':['comment clearfix']})
 
47
                        ]
 
48
 
 
49
    feeds          = [
 
50
                        (u'Feeds', u'http://rss.publika.md/stiri.xml')
 
51
                     ]
 
52
 
 
53
    def preprocess_html(self, soup):
 
54
        return self.adeify_images(soup)