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

« back to all changes in this revision

Viewing changes to recipes/wired_it.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
import re
1
2
from calibre.web.feeds.news import BasicNewsRecipe
2
3
 
3
 
class AdvancedUserRecipe1325758162(BasicNewsRecipe):
4
 
    title          = u'Wired'
 
4
class WiredITA(BasicNewsRecipe):
 
5
    title          = u'Wired.it'
 
6
    oldest_article = 1
 
7
    max_articles_per_feed = 50
 
8
    no_stylesheets  = True
 
9
    use_embedded_content  = False
 
10
    auto_cleanup = False
 
11
    encoding = 'utf8'
 
12
    masthead_url          = 'http://www.wired.com/images/home/wired_logo.gif'
 
13
    description = 'Wired - Make in Italy. Inventa, sbaglia, innova'
 
14
    publisher   = 'http://www.wired.it/'
5
15
    language = 'it'
6
 
    oldest_article = 7
7
 
    max_articles_per_feed = 100
8
 
    auto_cleanup = True
9
 
    remove_tags_after = [dict(name='div', attrs={'class':'article_content'})]
10
 
    feeds          = [(u'Wired', u'http://www.wired.it/rss.xml')]
11
 
    __author__      = 'faber1971'
12
 
    description = 'An American magazine that reports on how new technology affects culture, the economy, and politics'
 
16
    __author__ = 'isspro'
 
17
    publication_type = 'magazine'
 
18
 
 
19
    conversion_options = {'title'       : title,
 
20
                           'comments'    : description,
 
21
                           'language'    : language,
 
22
                           'publisher'   : publisher,
 
23
                           'authors'     : title,
 
24
                           'smarten_punctuation' : True
 
25
                         }
 
26
 
 
27
    keep_only_tags     = [
 
28
                          dict(name='div', attrs={'id':'main-article'})
 
29
                          ]
 
30
 
 
31
    remove_tags = [
 
32
                    dict(name='img', attrs={'class':'avatar img-circle'}),
 
33
                    dict(name='div', attrs={'class':'topics'}),
 
34
                    dict(name='div', attrs={'class':'social-share hidden-lg'}),
 
35
                    dict(name='span', attrs={'class':'label'})
 
36
                    ]
 
37
 
 
38
    extra_css = '''
 
39
        h1 {font-size:x-large;}
 
40
        p.lead {font-size:medium;}
 
41
        .who {line-height: 0pt; margin: 0pt;}
 
42
    '''
 
43
 
 
44
    preprocess_regexps = [
 
45
        (re.compile(r'Pubblicato'), lambda match: '')
 
46
 
 
47
        ]
 
48
 
 
49
    feeds          = [(u'Attualit\xe0', u'http://www.wired.it/attualita/feed/'),
 
50
                                  (u'Internet','http://www.wired.it/internet/feed/'),
 
51
                                  (u'Gadget','http://www.wired.it/gadget/feed/'),
 
52
                                  (u'Mobile','http://www.wired.it/mobile/feed/'),
 
53
                                  (u'Scienza','http://www.wired.it/scienza/feed/'),
 
54
                                  (u'Economia','http://www.wired.it/economia/feed/'),
 
55
                                  (u'LifeStyle','http://www.wired.it/lifestyle/feed/'),
 
56
                                  (u'Play','http://www.wired.it/play/feed/'),
 
57
 
 
58
                                ]