|
|
#1 |
|
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Sep 2010
Device: Kindle
|
How to update The Australian recipe for the new subscription model
The Australian newspaper has moved to a Freemium model and now requires a subscription to view most content in full.
Can someone who knows what they are doing please update the Recipe file. Thank you in advance. I tried adding part of The Wallstreet Journal recipe to make it login, but failed as it now stops loading the newspaper after a couple of seconds. This is what I did: needs_subscription = True def get_browser(self): br = BasicNewsRecipe.get_browser() if self.username is not None and self.password is not None: br.open('http://www.theaustralian.com.au/login') br.select_form(nr=1) br['user'] = self.username br['password'] = self.password res = br.submit() raw = res.read() if 'Thankyou,' not in raw: raise ValueError('Failed to log in, check your ' 'username and password') return br |
|
|
|
|
|
#2 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,648
Karma: 28549046
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Send me your username and password for that website in a private message and I'll see if I can add the login logic to the recipe
|
|
|
|
| Advert | |
|
|
|
|
#3 |
|
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Sep 2010
Device: Kindle
|
I have PM'd you the login. Thank you for your assistance with this.
It is a News Limited paper so I am guessing the login is similar to something they have done elsewhere in the world. |
|
|
|
|
|
#4 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,648
Karma: 28549046
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Login code will be in the next release. For the curious:
Code:
needs_subscription = 'optional'
def get_browser(self):
br = BasicNewsRecipe.get_browser(self)
if self.username and self.password:
br.open('http://www.theaustralian.com.au')
br.select_form(nr=0)
br['username'] = self.username
br['password'] = self.password
raw = br.submit().read()
if '>log out' not in raw.lower():
raise ValueError('Failed to log in to www.theaustralian.com.au'
' are your username and password correct?')
return br
|
|
|
|
|
|
#5 |
|
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Sep 2010
Device: Kindle
|
Thanks for your help. Your fix works great.
|
|
|
|
| Advert | |
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| The subscription model for ebooks hasn’t emerged yet, but it will | stonetools | General Discussions | 64 | 05-20-2011 03:01 PM |
| Apple Subscription Model - eBook Killer? | Harmon | General Discussions | 2 | 02-16-2011 02:55 PM |
| Recipe for The Australian | Valhalla | Calibre | 5 | 06-13-2010 05:38 PM |
| Apple App Store will now support subscription model for e-books | pilotbob | News | 8 | 03-18-2009 09:09 AM |
| Subscription model for content | JHeavner | Sony Reader | 9 | 02-09-2007 11:46 AM |