This is how I do it: let's say you want issue Vol. 38 No. 17.
Change the existing lrb_payed.recipe as follows:
Create the new constants
ARCHIVE_SUFFIX = '/v38/n17/contents'
ARCHIVE = INDEX + ARCHIVE_SUFFIX
Navigate to that issue and note the exact date. In this case
it would be '8 September 2016'. Create the new constant
ARCHIVE_DATE = '8 September 2016'
[Note: you should really be able to grab the date automatically,
but my previous code doesn't work with the latest recipe/website.
Don't have the energy to investigate this.]
Change line 44 from
soup = self.index_to_soup(self.INDEX)
to
soup = self.index_to_soup(self.ARCHIVE)
Change line 47 from
newdates = re.sub('\<.*\>', '', re.split('<br />', dates)[1])
to
newdates = self.ARCHIVE_DATE
Change line 51 from
self.cover_url = re.sub('/m/', '/l/', cover_item.a.img['src'])
to
self.cover_url = re.sub('/m/', '/l/', cover_item.img['src'])
Change line 52 from
content = self.INDEX + cover_item.a['href']
to
content = self.ARCHIVE
Unless you automate the process with a script, you need
to manually change ARCHIVE_SUFFIX and ARCHIVE_DATE
for every issue.
regards,
praimon
Quote:
Originally Posted by ztwig
Hi!
I'm a paid subscriber to the London Review of Books and was wondering if there was a way to alter the recipe to download previous issues of the magazine?
Any help would be greatly appreciated.
|