This commit is contained in:
Kovid Goyal 2017-06-18 09:14:43 +05:30
parent 9fe3cbacec
commit 1829e698f5
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -61,9 +61,9 @@ class FinancialTimes(BasicNewsRecipe):
br['password'] = self.password
br.submit()
return br
def get_cover_url(self):
from datetime import timedelta, date
from datetime import date
cover = 'http://img.kiosko.net/' + str(date.today().year) + '/' + date.today().strftime('%m') + '/' + date.today().strftime('%d') + '/uk/ft_uk.750.jpg'
br = BasicNewsRecipe.get_browser(self)
try:
@ -72,12 +72,12 @@ class FinancialTimes(BasicNewsRecipe):
index = 'http://en.kiosko.net/uk/np/ft_uk.html'
soup = self.index_to_soup(index)
for image in soup.findAll('img', src=True):
if image['src'].endswith('750.jpg'):
if image['src'].endswith('750.jpg'):
return image['src']
self.log("\nCover unavailable")
cover = None
return cover
def parse_index(self):
feeds = OrderedDict()
soup = self.index_to_soup(self.INDEX)