View Single Post
Old 11-17-2012, 09:27 AM   #1
Mwandishi
Junior Member
Mwandishi began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Nov 2012
Device: Nook
Question Recipe for Courrier International Abonné

Hello everyone,

I've run a quick check on the forum and think that this hasn't been posted up to now, please forgive me otherwise. As the only way of getting the (great) newspaper Courrier International when paying subscription is in .pdf and that it reads terrible on ereaders, I'd like to know if someone would be happy to help me with writing a recipe for it. From what I've read in the wiki & manual it would be somewhere halfway between that of NYTimes and The Economist.

There's already a recipe for Courrier International but from my understanding it's only for the general RSS feed and doesn't give full access to articles available when paying the subscription. Thus, the login bit of the recipe based on that of NYTimes (cf. manual). My problem is that I really don't know anything about python but I suppose the code would be something like:

Code:
def get_browser(self):
            br = BasicNewsRecipe.get_browser()
            if self.username is not None and self.password is not None:
                br.open('http://www.courrierinternational.com/login')
                br.select_form(name='login')
                br['USERID']   = self.username
                br['PASSWORD'] = self.password
                br.submit()
            return br
Likewise, based on the recipe for the economist, it gets the URL of the webpage with content of the current issue off the page:

http://www.economist.com/printedition/covers

The corresponding page for Courrier International would probably be:

http://www.courrierinternational.com/magazines_overview

But then I don't know how Calibre get the URL of the current issue from the previous URL. I guess the code selects the first link looking like: http://www.economist.com/printedition/* from the page so for Courrier International it might be something like getting the first link looking like:
http://www.courrierinternational.com/magazine/*

Then it'd have to follow the same parsing method, which I don't know how to parameter either

So would anyone be ready to have a look at it with me?

Thanks very much!
Mwandishi is offline   Reply With Quote