View Single Post
Old 10-15-2011, 06:45 PM   #8
Aeon
Junior Member
Aeon began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Oct 2011
Device: Kindle 4
The script provided by partymonkey does not work for me.

It would be very nice to have a standard recipe for fetching older issues. I'm positive it would be a quick fix to add this to the current recipe.

EDIT:
Quote:
needs_subscription = True

def get_browser(self):
br = BasicNewsRecipe.get_browser()
if self.username and self.password:
br.open('http://www.economist.com/user/login')
br.select_form(nr=1)
br['name'] = self.username
br['pass'] = self.password
res = br.submit()
raw = res.read()
if '>Log out<' not in raw:
raise ValueError('Failed to login to economist.com. '
'Check your username and password.')
return br


def get_cover_url(self):
br = self.browser
br.open(self.INDEX)
issue = '2011-09-10'
self.log('Fetching cover for issue: %s'%issue)
cover_url = "http://media.economist.com/sites/default/files/imagecache/print-cover-full/print-covers/%s_CNA400.jpg" %(issue.translate(None,'-'))
return cover_url
This does not work either.

Last edited by Aeon; 10-15-2011 at 07:18 PM.
Aeon is offline   Reply With Quote