Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 07-25-2010, 05:52 PM   #1
Maisy
Newbie e-reader
Maisy began at the beginning.
 
Maisy's Avatar
 
Posts: 3
Karma: 10
Join Date: Jul 2010
Location: The South
Device: Nook
Word Press login help

I struggled to get a basic news custom recipe to login to one of my private blogs ... finally found this post deep into the thread:

https://www.mobileread.com/forums/sho...&postcount=605

Quote:
Originally Posted by kiklop74 View Post
Add this to your recipe and it should work:

Code:
    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://content.nejm.org/cgi/login?uri=%2F')
            br.select_form(nr=0)
            br['username'] = self.username
            br['code'    ] = self.password
            br.submit()
        return br
Thanks Kiklop74!

Nothing else online even got me close to that. I never found the "needs_subscription = True" part attached to the rest of the code, for whatever reason. So I finally got it all together and made it work.

My blog is a WP one, privatized, and I couldn't find anything online written about anyone using Calibre to login to a WP blog.

So this is what I came up with that will allow a privatized blog, like one using "Private WP" plugin with WP:

Code:
    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('Your-WP-Blog-Login-Page-URL-HERE')
            br.select_form(name='loginform')
            br['log'] = self.username
            br['pwd'    ] = self.password
            br.submit()
        return br
In my case, using Private WP one is auth_dir automatically to the top directory where the blog is located, so when Calibre is being used to get any RSS it has to login first, thus the top WP directory is all you need to get to the login. In my case it was like: "http://URL.com"

It works great. Now I just need to get a better recipe set up to work with the Carrington Theme for WP, or change my theme 'cause it's awful looking, whereas other blogs I have used basic recipe to fetch rss look nice. There is no difference between all these blogs recipes in how they are parsed, and none but that one uses "Carrington" so it seems that's the basic difference, and I'm not wanting to get deep into coding to make it better. It'd be much easier to just switch WP themes. FWIW.
Maisy is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
GRYPHONWOOD PRESS/BLADE RED PRESS Halloween Giveaway Winter Deals and Resources (No Self-Promotion or Affiliate Links) 0 10-30-2009 06:39 AM
Any word on the UK press conf today? Riocaz News 17 08-26-2009 04:38 PM
Romance Ebers, Georg: A Word, Only a Word. V1. 20 Mar 2009 crutledge Kindle Books 0 03-20-2009 08:14 AM
Romance Ebers, Georg: A Word, Only a Word. V1. 20 Mar 2009 crutledge IMP Books 0 03-20-2009 08:12 AM
Romance Ebers, Georg: A Word, Only a Word. V1. 20 Mar 2009 crutledge ePub Books 0 03-20-2009 08:09 AM


All times are GMT -4. The time now is 04:38 AM.


MobileRead.com is a privately owned, operated and funded community.