mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update Harpers Full. Fixes #1153203 (Updated recipe for harpers full)
This commit is contained in:
parent
db2e6bcb97
commit
22c8c3c5b6
@ -1,5 +1,5 @@
|
|||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2008-2012, Darko Miletic <darko.miletic at gmail.com>'
|
__copyright__ = '2008-2013, Darko Miletic <darko.miletic at gmail.com>'
|
||||||
'''
|
'''
|
||||||
harpers.org - paid subscription/ printed issue articles
|
harpers.org - paid subscription/ printed issue articles
|
||||||
This recipe only get's article's published in text format
|
This recipe only get's article's published in text format
|
||||||
@ -72,7 +72,8 @@ class Harpers_full(BasicNewsRecipe):
|
|||||||
|
|
||||||
#go to the current issue
|
#go to the current issue
|
||||||
soup1 = self.index_to_soup(currentIssue_url)
|
soup1 = self.index_to_soup(currentIssue_url)
|
||||||
date = re.split('\s\|\s',self.tag_to_string(soup1.head.title.string))[0]
|
currentIssue_title = self.tag_to_string(soup1.head.title.string)
|
||||||
|
date = re.split('\s\|\s',currentIssue_title)[0]
|
||||||
self.timefmt = u' [%s]'%date
|
self.timefmt = u' [%s]'%date
|
||||||
|
|
||||||
#get cover
|
#get cover
|
||||||
@ -84,27 +85,23 @@ class Harpers_full(BasicNewsRecipe):
|
|||||||
count = 0
|
count = 0
|
||||||
for item in soup1.findAll('div', attrs={'class':'articleData'}):
|
for item in soup1.findAll('div', attrs={'class':'articleData'}):
|
||||||
text_links = item.findAll('h2')
|
text_links = item.findAll('h2')
|
||||||
for text_link in text_links:
|
if text_links:
|
||||||
if count == 0:
|
for text_link in text_links:
|
||||||
count = 1
|
if count == 0:
|
||||||
else:
|
count = 1
|
||||||
url = text_link.a['href']
|
else:
|
||||||
title = text_link.a.contents[0]
|
url = text_link.a['href']
|
||||||
date = strftime(' %B %Y')
|
title = self.tag_to_string(text_link.a)
|
||||||
articles.append({
|
date = strftime(' %B %Y')
|
||||||
'title' :title
|
articles.append({
|
||||||
,'date' :date
|
'title' :title
|
||||||
,'url' :url
|
,'date' :date
|
||||||
,'description':''
|
,'url' :url
|
||||||
})
|
,'description':''
|
||||||
return [(soup1.head.title.string, articles)]
|
})
|
||||||
|
return [(currentIssue_title, articles)]
|
||||||
|
|
||||||
def print_version(self, url):
|
def print_version(self, url):
|
||||||
return url + '?single=1'
|
return url + '?single=1'
|
||||||
|
|
||||||
def cleanup(self):
|
|
||||||
soup = self.index_to_soup('http://harpers.org/')
|
|
||||||
signouturl=self.tag_to_string(soup.find('li', attrs={'class':'subLogOut'}).findNext('li').a['href'])
|
|
||||||
self.log(signouturl)
|
|
||||||
self.browser.open(signouturl)
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user