~ubuntu-branches/debian/sid/calibre/sid

« back to all changes in this revision

Viewing changes to recipes/disinformatico.recipe

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2014-02-27 07:48:06 UTC
  • mto: This revision was merged to the branch mainline in revision 74.
  • Revision ID: package-import@ubuntu.com-20140227074806-64wdebb3ptosxhhx
Tags: upstream-1.25.0+dfsg
ImportĀ upstreamĀ versionĀ 1.25.0+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from calibre.web.feeds.news import BasicNewsRecipe
 
2
 
 
3
class Disinformatico(BasicNewsRecipe):
 
4
    title          = u'Il Disinformatico - Paolo Attivissimo'
 
5
    oldest_article = 7
 
6
    max_articles_per_feed = 25
 
7
    auto_cleanup = False
 
8
    use_embedded_content  = False
 
9
    description = 'Un blog di Paolo Attivissimo, giornalista informatico e cacciatore di bufale'
 
10
    publisher   = 'http://attivissimo.blogspot.it'
 
11
    language = 'it'
 
12
    __author__ = 'isspro'
 
13
    publication_type = 'blog'
 
14
 
 
15
    conversion_options = {'title'       : title,
 
16
                           'comments'    : description,
 
17
                           'language'    : language,
 
18
                           'publisher'   : 'Paolo Attivissimo',
 
19
                           'authors'     : 'Paolo Attivissimo',
 
20
                           'smarten_punctuation' : True
 
21
                         }
 
22
 
 
23
    keep_only_tags     = [
 
24
                          dict(name='div', attrs={'class':'post hentry'})
 
25
                          ]
 
26
 
 
27
    remove_tags = [
 
28
                    dict(name='span', attrs={'id':'NumCom'}),
 
29
                    dict(name='div', attrs={'id':'PostFooter'})
 
30
                    ]
 
31
 
 
32
    extra_css = '''
 
33
        h1 {font-size:x-large;}
 
34
        .post-body {margin: 0pt;}
 
35
        .post-timestamp {margin-right: 0pt;}
 
36
    '''
 
37
 
 
38
    def parse_feeds(self):
 
39
        feeds = BasicNewsRecipe.parse_feeds(self)
 
40
        # Loop through all feeds.
 
41
        for feed in feeds:
 
42
            # Loop through all articles in feed.
 
43
            for article in feed.articles[:]:
 
44
                if 'podcast' in article.title:
 
45
                    feed.articles.remove(article)
 
46
 
 
47
        return feeds
 
48
 
 
49
    feeds          = [(u'Home', u'http://feeds.feedburner.com/Disinformatico')]