mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Folha de Sao Paulo by Saverio Palmieri Neto
This commit is contained in:
parent
942612a34b
commit
f9e79e10dd
74
resources/recipes/folhadesaopaulo.recipe
Normal file
74
resources/recipes/folhadesaopaulo.recipe
Normal file
@ -0,0 +1,74 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2010, Saverio Palmieri Neto <saverio.palmieri at gmail.com>'
|
||||
'''
|
||||
folha.uol.com.br
|
||||
'''
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
class FolhaOnline(BasicNewsRecipe):
|
||||
title = 'Folha de Sao Paulo'
|
||||
__author__ = 'Saverio Palmieri Neto'
|
||||
description = 'Brazilian news from Folha de Sao Paulo Online'
|
||||
publisher = 'Folha de Sao Paulo'
|
||||
category = 'Brasil, news'
|
||||
oldest_article = 2
|
||||
max_articles_per_feed = 1000
|
||||
summary_length = 2048
|
||||
no_stylesheets = True
|
||||
use_embedded_content = False
|
||||
timefmt = ' [%d %b %Y (%a)]'
|
||||
encoding = 'cp1252'
|
||||
cover_url = 'http://lh5.ggpht.com/_hEb7sFmuBvk/TFoiKLRS5dI/AAAAAAAAADM/kcVKggZwKnw/capa_folha.jpg'
|
||||
cover_margins = (5,5,'white')
|
||||
remove_javascript = True
|
||||
|
||||
keep_only_tags = [dict(name='div', attrs={'id':'articleNew'})]
|
||||
|
||||
remove_tags = [
|
||||
dict(name='script')
|
||||
,dict(name='div',
|
||||
attrs={'id':[
|
||||
'articleButton'
|
||||
,'bookmarklets'
|
||||
,'ad-180x150-1'
|
||||
,'contextualAdsArticle'
|
||||
,'articleEnd'
|
||||
,'articleComments'
|
||||
]})
|
||||
,dict(name='div',
|
||||
attrs={'class':[
|
||||
'openBox adslibraryArticle'
|
||||
]})
|
||||
,dict(name='a')
|
||||
,dict(name='iframe')
|
||||
,dict(name='link')
|
||||
]
|
||||
|
||||
|
||||
feeds = [
|
||||
(u'Em cima da hora', u'http://feeds.folha.uol.com.br/emcimadahora/rss091.xml')
|
||||
,(u'Ambiente', u'http://feeds.folha.uol.com.br/ambiente/rss091.xml')
|
||||
,(u'Bichos', u'http://feeds.folha.uol.com.br/bichos/rss091.xml')
|
||||
,(u'Poder', u'http://feeds.folha.uol.com.br/poder/rss091.xml')
|
||||
,(u'Ciencia', u'http://feeds.folha.uol.com.br/ciencia/rss091.xml')
|
||||
,(u'Cotidiano', u'http://feeds.folha.uol.com.br/cotidiado/rss091.xml')
|
||||
,(u'Saber', u'http://feeds.folha.uol.com.br/saber/rss091.xml')
|
||||
,(u'Equilíbrio e Saúde', u'http://feeds.folha.uol.com.br/equilibrioesaude/rss091.xml')
|
||||
,(u'Esporte', u'http://feeds.folha.uol.com.br/esporte/rss091.xml')
|
||||
,(u'Ilustrada', u'http://feeds.folha.uol.com.br/ilustrada/rss091.xml')
|
||||
,(u'Ilustríssima', u'http://feeds.folha.uol.com.br/ilustrissima/rss091.xml')
|
||||
,(u'Mercado', u'http://feeds.folha.uol.com.br/mercado/rss091.xml')
|
||||
,(u'Mundo', u'http://feeds.folha.uol.com.br/mundo/rss091.xml')
|
||||
,(u'Tec', u'http://feeds.folha.uol.com.br/tec/rss091.xml')
|
||||
,(u'Turismo', u'http://feeds.folha.uol.com.br/turismo/rss091.xml')
|
||||
]
|
||||
|
||||
def preprocess_html(self, soup):
|
||||
for item in soup.findAll(style=True):
|
||||
del item['style']
|
||||
return soup
|
||||
|
||||
language = 'pt'
|
Loading…
x
Reference in New Issue
Block a user