I have created a recipe for chronicle tribune but there is some problem with login. Can anyone please fix it.
Code:
import string, re
from calibre import strftime
from calibre.web.feeds.recipes import BasicNewsRecipe
from calibre.ebooks.BeautifulSoup import BeautifulSoup
import mechanize
import urllib, urllib2, cookielib
class AdvancedUserRecipe1295890060(BasicNewsRecipe):
title = u'Chronicle Tribune'
oldest_article = 1
max_articles_per_feed = 100
needs_subscription = True
LOGIN='https://secure.townnews.com/shared-content/subscription/authenticate/index.php?mode=start&domain=chronicle-tribune.com&usereg=1&url=http://chronicle-tribune.com//articles/2011/01/24/news/doc4d3d06fa4d789364914945.txt&discover=0&amex=0'
feeds= [(u'News', u'http://www.chronicle-tribune.com/?rss=news')]
def get_browser(self):
br = BasicNewsRecipe.get_browser()
br.set_debug_responses(True)
if self.username is not None and self.password is not None:
br.open(self.LOGIN)
br.select_form(nr=0)
br['username'] = self.username
br['password'] = self.password
br['use_cookie']='1'
br.submit()
Username and password:
http://pastebin.com/LepF1BZ4