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

« back to all changes in this revision

Viewing changes to src/calibre/web/feeds/recipes/recipe_estadao.py

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-07-30 12:49:41 UTC
  • mto: This revision was merged to the branch mainline in revision 13.
  • Revision ID: james.westby@ubuntu.com-20090730124941-kviipg9ypwgppulc
Tags: upstream-0.6.3+dfsg
ImportĀ upstreamĀ versionĀ 0.6.3+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env  python
2
 
 
3
 
__license__   = 'GPL v3'
4
 
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
5
 
'''
6
 
estadao.com.br
7
 
'''
8
 
 
 
1
#!/usr/bin/env  python
 
2
 
 
3
__license__   = 'GPL v3'
 
4
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
 
5
'''
 
6
estadao.com.br
 
7
'''
 
8
 
9
9
from calibre.web.feeds.news import BasicNewsRecipe
10
10
 
11
 
class Estadao(BasicNewsRecipe):
12
 
    title                 = 'O Estado de S. Paulo'
13
 
    __author__            = 'Darko Miletic'
14
 
    description           = 'News from Brasil in Portugese'
15
 
    publisher             = 'O Estado de S. Paulo'
16
 
    category              = 'news, politics, Brasil'    
17
 
    oldest_article        = 2
18
 
    max_articles_per_feed = 100
19
 
    no_stylesheets        = True
20
 
    use_embedded_content  = False
21
 
    encoding              = 'utf8'
22
 
    cover_url             = 'http://www.estadao.com.br/img/logo_estadao.png'
23
 
    remove_javascript     = True
24
 
    
25
 
    html2lrf_options = [
 
11
class Estadao(BasicNewsRecipe):
 
12
    title                 = 'O Estado de S. Paulo'
 
13
    __author__            = 'Darko Miletic'
 
14
    description           = 'News from Brasil in Portuguese'
 
15
    publisher             = 'O Estado de S. Paulo'
 
16
    category              = 'news, politics, Brasil'
 
17
    oldest_article        = 2
 
18
    max_articles_per_feed = 100
 
19
    no_stylesheets        = True
 
20
    use_embedded_content  = False
 
21
    encoding              = 'utf8'
 
22
    cover_url             = 'http://www.estadao.com.br/img/logo_estadao.png'
 
23
    remove_javascript     = True
 
24
 
 
25
    html2lrf_options = [
26
26
                          '--comment', description
27
 
                        , '--category', category
28
 
                        , '--publisher', publisher
29
 
                        ]
30
 
    
31
 
    html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"' 
32
 
                        
33
 
    keep_only_tags = [dict(name='div', attrs={'id':'c1'})]
34
 
 
35
 
    remove_tags = [
36
 
                     dict(name=['script','object','form','ul'])
37
 
                    ,dict(name='div', attrs={'id':['votacao','estadaohoje']})
38
 
                    ,dict(name='p', attrs={'id':'ctrl_texto'})
39
 
                    ,dict(name='p', attrs={'class':'texto'})
40
 
                  ]
41
 
    
42
 
    feeds = [
43
 
               (u'Manchetes Estadao', u'http://www.estadao.com.br/rss/manchetes.xml')
44
 
              ,(u'Ultimas noticias', u'http://www.estadao.com.br/rss/ultimas.xml')
45
 
              ,(u'Nacional', u'http://www.estadao.com.br/rss/nacional.xml')
46
 
              ,(u'Internacional', u'http://www.estadao.com.br/rss/internacional.xml')
47
 
              ,(u'Cidades', u'http://www.estadao.com.br/rss/cidades.xml')
48
 
              ,(u'Esportes', u'http://www.estadao.com.br/rss/esportes.xml')
49
 
              ,(u'Arte & Lazer', u'http://www.estadao.com.br/rss/arteelazer.xml')
50
 
              ,(u'Economia', u'http://www.estadao.com.br/rss/economia.xml')
51
 
              ,(u'Vida &', u'http://www.estadao.com.br/rss/vidae.xml')
52
 
            ]
53
 
 
54
 
    def preprocess_html(self, soup):
55
 
        ifr = soup.find('iframe')
56
 
        if ifr:
57
 
           ifr.extract()
58
 
        for item in soup.findAll(style=True):
59
 
            del item['style']
60
 
        return soup
61
 
 
62
 
    language = _('Portugese')    
 
 
b'\\ No newline at end of file'
 
27
                        , '--category', category
 
28
                        , '--publisher', publisher
 
29
                        ]
 
30
 
 
31
    html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"'
 
32
 
 
33
    keep_only_tags = [dict(name='div', attrs={'id':'c1'})]
 
34
 
 
35
    remove_tags = [
 
36
                     dict(name=['script','object','form','ul'])
 
37
                    ,dict(name='div', attrs={'id':['votacao','estadaohoje']})
 
38
                    ,dict(name='p', attrs={'id':'ctrl_texto'})
 
39
                    ,dict(name='p', attrs={'class':'texto'})
 
40
                  ]
 
41
 
 
42
    feeds = [
 
43
               (u'Manchetes Estadao', u'http://www.estadao.com.br/rss/manchetes.xml')
 
44
              ,(u'Ultimas noticias', u'http://www.estadao.com.br/rss/ultimas.xml')
 
45
              ,(u'Nacional', u'http://www.estadao.com.br/rss/nacional.xml')
 
46
              ,(u'Internacional', u'http://www.estadao.com.br/rss/internacional.xml')
 
47
              ,(u'Cidades', u'http://www.estadao.com.br/rss/cidades.xml')
 
48
              ,(u'Esportes', u'http://www.estadao.com.br/rss/esportes.xml')
 
49
              ,(u'Arte & Lazer', u'http://www.estadao.com.br/rss/arteelazer.xml')
 
50
              ,(u'Economia', u'http://www.estadao.com.br/rss/economia.xml')
 
51
              ,(u'Vida &', u'http://www.estadao.com.br/rss/vidae.xml')
 
52
            ]
 
53
 
 
54
    def preprocess_html(self, soup):
 
55
        ifr = soup.find('iframe')
 
56
        if ifr:
 
57
           ifr.extract()
 
58
        for item in soup.findAll(style=True):
 
59
            del item['style']
 
60
        return soup
 
61
 
 
62
    language = _('Portuguese')