mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix some obvious bugs in the FT recipes
This commit is contained in:
parent
3ca4670ce9
commit
e226eaaf5f
@ -4,7 +4,6 @@ __copyright__ = '2010-2011, Darko Miletic <darko.miletic at gmail.com>'
|
|||||||
www.ft.com
|
www.ft.com
|
||||||
'''
|
'''
|
||||||
|
|
||||||
import datetime
|
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
class FinancialTimes_rss(BasicNewsRecipe):
|
class FinancialTimes_rss(BasicNewsRecipe):
|
||||||
@ -22,7 +21,7 @@ class FinancialTimes_rss(BasicNewsRecipe):
|
|||||||
encoding = 'utf8'
|
encoding = 'utf8'
|
||||||
publication_type = 'newspaper'
|
publication_type = 'newspaper'
|
||||||
masthead_url = 'http://im.media.ft.com/m/img/masthead_main.jpg'
|
masthead_url = 'http://im.media.ft.com/m/img/masthead_main.jpg'
|
||||||
LOGIN = 'https://registration.ft.com/registration/barrier/login'
|
LOGIN = 'https://accounts.ft.com/login'
|
||||||
INDEX = 'http://www.ft.com'
|
INDEX = 'http://www.ft.com'
|
||||||
|
|
||||||
conversion_options = {
|
conversion_options = {
|
||||||
@ -38,8 +37,8 @@ class FinancialTimes_rss(BasicNewsRecipe):
|
|||||||
br.open(self.INDEX)
|
br.open(self.INDEX)
|
||||||
if self.username is not None and self.password is not None:
|
if self.username is not None and self.password is not None:
|
||||||
br.open(self.LOGIN)
|
br.open(self.LOGIN)
|
||||||
br.select_form(name='loginForm')
|
br.select_form(name='login')
|
||||||
br['username'] = self.username
|
br['email'] = self.username
|
||||||
br['password'] = self.password
|
br['password'] = self.password
|
||||||
br.submit()
|
br.submit()
|
||||||
return br
|
return br
|
||||||
@ -97,10 +96,3 @@ class FinancialTimes_rss(BasicNewsRecipe):
|
|||||||
if not item.has_key('alt'):
|
if not item.has_key('alt'):
|
||||||
item['alt'] = 'image'
|
item['alt'] = 'image'
|
||||||
return soup
|
return soup
|
||||||
|
|
||||||
def get_cover_url(self):
|
|
||||||
cdate = datetime.date.today()
|
|
||||||
if cdate.isoweekday() == 7:
|
|
||||||
cdate -= datetime.timedelta(days=1)
|
|
||||||
return cdate.strftime('http://specials.ft.com/vtf_pdf/%d%m%y_FRONT1_USA.pdf')
|
|
||||||
|
|
||||||
|
@ -40,9 +40,7 @@ class FinancialTimes(BasicNewsRecipe):
|
|||||||
br.submit()
|
br.submit()
|
||||||
return br
|
return br
|
||||||
|
|
||||||
keep_only_tags = [
|
keep_only_tags = [dict(name='div', attrs={'class':['fullstory fullstoryHeader','fullstory fullstoryBody','ft-story-header','ft-story-body','index-detail']})]
|
||||||
dict(name='div' , attrs={'class':['master-row editorialSection']})
|
|
||||||
]
|
|
||||||
remove_tags = [
|
remove_tags = [
|
||||||
dict(name='style', attrs={'id':'antiClickjack'}),
|
dict(name='style', attrs={'id':'antiClickjack'}),
|
||||||
dict(name='div', attrs={'id':'floating-con'}),
|
dict(name='div', attrs={'id':'floating-con'}),
|
||||||
|
@ -49,9 +49,7 @@ class FinancialTimes(BasicNewsRecipe):
|
|||||||
br.submit()
|
br.submit()
|
||||||
return br
|
return br
|
||||||
|
|
||||||
keep_only_tags = [
|
keep_only_tags = [dict(name='div', attrs={'class':['fullstory fullstoryHeader','fullstory fullstoryBody','ft-story-header','ft-story-body','index-detail']})]
|
||||||
dict(name='div' , attrs={'class':['master-row editorialSection']})
|
|
||||||
]
|
|
||||||
remove_tags = [
|
remove_tags = [
|
||||||
dict(name='div', attrs={'id':'floating-con'})
|
dict(name='div', attrs={'id':'floating-con'})
|
||||||
,dict(name=['meta','iframe','base','object','embed','link'])
|
,dict(name=['meta','iframe','base','object','embed','link'])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user