~stub/ubuntu/precise/calibre/devel

« back to all changes in this revision

Viewing changes to resources/recipes/el_periodico.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:
5
5
__copyright__   = '04 December 2010, desUBIKado'
6
6
__author__      = 'desUBIKado'
7
7
__description__ = 'Daily newspaper from Aragon'
8
 
__version__     = 'v0.05'
9
 
__date__        = '07, December 2010'
 
8
__version__     = 'v0.07'
 
9
__date__        = '06, February 2011'
10
10
'''
11
11
elperiodicodearagon.com
12
12
'''
38
38
                            ,'publisher' : publisher
39
39
                         }
40
40
 
41
 
    feeds              = [(u'Arag\xf3n', u'http://elperiodicodearagon.com/RSS/2.xml'),
42
 
                          (u'Internacional', u'http://elperiodicodearagon.com/RSS/4.xml'),
43
 
                          (u'Espa\xf1a', u'http://elperiodicodearagon.com/RSS/3.xml'),
44
 
                          (u'Econom\xeda', u'http://elperiodicodearagon.com/RSS/5.xml'),
45
 
                          (u'Deportes', u'http://elperiodicodearagon.com/RSS/7.xml'),
46
 
                          (u'Real Zaragoza', u'http://elperiodicodearagon.com/RSS/10.xml'),
47
 
                          (u'Opini\xf3n', u'http://elperiodicodearagon.com/RSS/103.xml'),
48
 
                          (u'Escenarios', u'http://elperiodicodearagon.com/RSS/105.xml'),
49
 
                          (u'Sociedad', u'http://elperiodicodearagon.com/RSS/104.xml'),
50
 
                          (u'Gente', u'http://elperiodicodearagon.com/RSS/330.xml')]
 
41
    feeds              = [
 
42
                           (u'Arag\xf3n', u'http://elperiodicodearagon.com/RSS/2.xml'),
 
43
                           (u'Internacional', u'http://elperiodicodearagon.com/RSS/4.xml'),
 
44
                           (u'Espa\xf1a', u'http://elperiodicodearagon.com/RSS/3.xml'),
 
45
                           (u'Econom\xeda', u'http://elperiodicodearagon.com/RSS/5.xml'),
 
46
                           (u'Deportes', u'http://elperiodicodearagon.com/RSS/7.xml'),
 
47
                           (u'Real Zaragoza', u'http://elperiodicodearagon.com/RSS/10.xml'),
 
48
                           (u'Opini\xf3n', u'http://elperiodicodearagon.com/RSS/103.xml'),
 
49
                           (u'Escenarios', u'http://elperiodicodearagon.com/RSS/105.xml'),
 
50
                           (u'Sociedad', u'http://elperiodicodearagon.com/RSS/104.xml'),
 
51
                           (u'Gente', u'http://elperiodicodearagon.com/RSS/330.xml')
 
52
                         ]
51
53
 
52
54
 
53
55
    extra_css = '''
54
 
                    h3{font-family:Arial,Helvetica,sans-serif; font-weight:bold;font-size:xx-large;}
55
 
                    h2{font-family:Arial,Helvetica,sans-serif; font-weight:normal;font-size:small;}
56
 
                    dd{font-family:Arial,Helvetica,sans-serif; font-weight:normal;font-size:small;}
 
56
                    h3 {font-family:Arial,Helvetica,sans-serif; font-weight:bold;font-size:30px;}
 
57
                    h2 {font-family:Arial,Helvetica,sans-serif; font-weight:bold;font-size:18px;}
 
58
                    h4 {font-family:Arial,Helvetica,sans-serif; font-style:italic; font-weight:normal;font-size:20px;}
 
59
                    .columnaDeRecursosRelacionados {font-family:Arial,Helvetica,sans-serif; font-weight:bold;font-size:14px;}
 
60
                    img{margin-bottom: 0.4em}
57
61
                '''
58
62
 
59
63
    remove_attributes = ['height','width']
82
86
                          dict(name='a', attrs={'class':'AvisoComentario'}),
83
87
                          dict(name='div', attrs={'class':'CajaAvisoComentario'}),
84
88
                          dict(name='div', attrs={'class':'navegaNoticias'}),
 
89
                          dict(name='div', attrs={'class':'Mensaje'}),
85
90
                          dict(name='div', attrs={'id':'PaginadorDiCom'}),
86
91
                          dict(name='div', attrs={'id':'CajaAccesoCuentaUsuario'}),
87
92
                          dict(name='div', attrs={'id':'CintilloComentario'}),
107
112
        (re.compile(r'<p> </p>', re.DOTALL|re.IGNORECASE), lambda match: ''),
108
113
        (re.compile(r'<p id="">', re.DOTALL|re.IGNORECASE), lambda match: '<p>')
109
114
        ]
 
115
 
 
116
    # Para sustituir el video incrustado de YouTube por una imagen
 
117
 
 
118
    def preprocess_html(self, soup):
 
119
        for video_yt in soup.findAll('iframe',{'title':'YouTube video player'}):
 
120
            if video_yt:
 
121
               video_yt.name = 'img'
 
122
               fuente = video_yt['src']
 
123
               fuente2 = fuente.replace('http://www.youtube.com/embed/','http://img.youtube.com/vi/')
 
124
               video_yt['src'] = fuente2 + '/0.jpg'
 
125
 
 
126
        return soup