mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update Folha de Sao Paolo
This commit is contained in:
parent
95b884612e
commit
5674dd141e
@ -49,30 +49,10 @@ class FolhaOnline(BasicNewsRecipe):
|
|||||||
cover_margins = (0,0,'white')
|
cover_margins = (0,0,'white')
|
||||||
masthead_url = 'http://f.i.uol.com.br/fsp/furniture/images/lgo-fsp-430x50-ffffff.gif'
|
masthead_url = 'http://f.i.uol.com.br/fsp/furniture/images/lgo-fsp-430x50-ffffff.gif'
|
||||||
|
|
||||||
keep_only_tags = [dict(name='div', attrs={'id':'articleNew'})]
|
keep_only_tags = [
|
||||||
remove_tags = [
|
dict(name='div', attrs={'id':'articleNew'}),
|
||||||
dict(name='div',
|
dict(name='article', id='news'),
|
||||||
attrs={'id':[
|
|
||||||
'articleButton'
|
|
||||||
,'bookmarklets'
|
|
||||||
,'ad-180x150-1'
|
|
||||||
,'contextualAdsArticle'
|
|
||||||
,'articleEnd'
|
|
||||||
,'articleComments'
|
|
||||||
]})
|
|
||||||
,dict(name='div',
|
|
||||||
attrs={'class':[
|
|
||||||
'openBox adslibraryArticle'
|
|
||||||
,'toolbar'
|
|
||||||
]})
|
|
||||||
|
|
||||||
,dict(name='a')
|
|
||||||
,dict(name='iframe')
|
|
||||||
,dict(name='link')
|
|
||||||
,dict(name='script')
|
|
||||||
,dict(name='li')
|
|
||||||
]
|
]
|
||||||
remove_tags_after = dict(name='div',attrs={'id':'articleEnd'})
|
|
||||||
|
|
||||||
feeds = [
|
feeds = [
|
||||||
(u'Em cima da hora', u'http://feeds.folha.uol.com.br/emcimadahora/rss091.xml')
|
(u'Em cima da hora', u'http://feeds.folha.uol.com.br/emcimadahora/rss091.xml')
|
||||||
|
@ -26,17 +26,20 @@ class FSP(BasicNewsRecipe):
|
|||||||
# remove_tags_before = dict(name='p')
|
# remove_tags_before = dict(name='p')
|
||||||
# remove_tags_before = dict(name='div', id='articleNew')
|
# remove_tags_before = dict(name='div', id='articleNew')
|
||||||
# remove_tags_after = dict(name='div', id='articleNew')
|
# remove_tags_after = dict(name='div', id='articleNew')
|
||||||
keep_only_tags = [dict(name='div', id='articleNew'), dict(name='table', attrs={'class':'articleGraphic'})]
|
keep_only_tags = [
|
||||||
|
dict(name='div', id='articleNew'), dict(name='table', attrs={'class':'articleGraphic'}),
|
||||||
|
dict(name='article', id='news'),
|
||||||
|
]
|
||||||
publication_type = 'newspaper'
|
publication_type = 'newspaper'
|
||||||
simultaneous_downloads = 5
|
simultaneous_downloads = 5
|
||||||
# remove_tags = [dict(name='td', attrs={'align':'center'})]
|
# remove_tags = [dict(name='td', attrs={'align':'center'})]
|
||||||
remove_attributes = ['height','width']
|
remove_attributes = ['height','width']
|
||||||
# fixes the problem with the section names
|
# fixes the problem with the section names
|
||||||
section_dict = {'cotidian' : 'cotidiano', 'ilustrad': 'ilustrada', \
|
section_dict = {'cotidian' : 'cotidiano', 'ilustrad': 'ilustrada',
|
||||||
'quadrin': 'quadrinhos' , 'opiniao' : u'opini\xE3o', \
|
'quadrin': 'quadrinhos' , 'opiniao' : u'opini\xE3o',
|
||||||
'ciencia' : u'ci\xeancia' , 'saude' : u'sa\xfade', \
|
'ciencia' : u'ci\xeancia' , 'saude' : u'sa\xfade',
|
||||||
'ribeirao' : u'ribeir\xE3o' , 'equilibrio' : u'equil\xedbrio', \
|
'ribeirao' : u'ribeir\xE3o' , 'equilibrio' : u'equil\xedbrio',
|
||||||
'imoveis' : u'im\xf3veis', 'negocios' : u'neg\xf3cios', \
|
'imoveis' : u'im\xf3veis', 'negocios' : u'neg\xf3cios',
|
||||||
'veiculos' : u've\xedculos', 'corrida' : 'folha corrida'}
|
'veiculos' : u've\xedculos', 'corrida' : 'folha corrida'}
|
||||||
|
|
||||||
# this solves the problem with truncated content in Kindle
|
# this solves the problem with truncated content in Kindle
|
||||||
@ -89,21 +92,8 @@ img { background: none !important; float: none; margin: 0px; }
|
|||||||
br['user'] = self.username
|
br['user'] = self.username
|
||||||
br['pass'] = self.password
|
br['pass'] = self.password
|
||||||
br.submit().read()
|
br.submit().read()
|
||||||
## if 'Please try again' in raw:
|
|
||||||
## raise Exception('Your username and password are incorrect')
|
|
||||||
return br
|
return br
|
||||||
|
|
||||||
# def postprocess_html(self, soup, first_fetch):
|
|
||||||
# #Clean-up normal articles
|
|
||||||
# tags = soup.findAll('div', id='articleNew')
|
|
||||||
# if tags and tags[0]:
|
|
||||||
# return tags[0]
|
|
||||||
# #Clean-up first page
|
|
||||||
# tags = soup.findAll('div', attrs={'class':'double_column facsimile'})
|
|
||||||
# if tags and tags[0]:
|
|
||||||
# return tags[0]
|
|
||||||
# return soup
|
|
||||||
|
|
||||||
def parse_index(self):
|
def parse_index(self):
|
||||||
# Searching for the index page on the HOMEPAGE
|
# Searching for the index page on the HOMEPAGE
|
||||||
# hpsoup = self.index_to_soup(self.HOMEPAGE)
|
# hpsoup = self.index_to_soup(self.HOMEPAGE)
|
||||||
@ -174,5 +164,3 @@ img { background: none !important; float: none; margin: 0px; }
|
|||||||
# feeds.insert(0,(u'primeira p\xe1gina', [{'title':u'Primeira p\xe1gina' , 'url':minha_capa}]))
|
# feeds.insert(0,(u'primeira p\xe1gina', [{'title':u'Primeira p\xe1gina' , 'url':minha_capa}]))
|
||||||
# feeds[0][1].insert(0,{'title':u'fac-s\xedmile da capa' , 'url':self.HOMEPAGE+self.FIRSTPAGE})
|
# feeds[0][1].insert(0,{'title':u'fac-s\xedmile da capa' , 'url':self.HOMEPAGE+self.FIRSTPAGE})
|
||||||
return feeds
|
return feeds
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user