View Single Post
Old 11-21-2010, 11:47 AM   #1
alexisvx
Junior Member
alexisvx began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Nov 2010
Device: Kindle
User/Pass not recognised in Fetch News

Hi,
I have tried to make a recipe for 'Screen International' which needs a subscription (I am a subscriber). Although I manage to get all the articles downloaded, they are all cut in half and say in the body of the article: 'Subscriber only content, You need to be a subscriber to read the article'. I do insert the correct username and password in the Calibre 'Fetch News' section. I have never used python before, can someone tell me who to properly input the username password in the recipe? Thank you for your help. ( I have included the recipe below)

import mechanize, string, urllib, time, re

class AdvancedUserRecipe1290343011(BasicNewsRecipe):
title = u'Screen International 5'
oldest_article = 30
max_articles_per_feed = 100
needs_subscription = True

def get_browser(self):
br = BasicNewsRecipe.get_browser()
br.open('http://www.screendaily.com')
req = mechanize.Request(
'http://www.screendaily.com/sign-in?js=yes&height=auto&width=620',
headers = {
'Referer':'http://www.screendaily.com/',
},
data=urllib.urlencode({
'logging_in' : 'Y',
'returnURL' : '/',
'SIemail': self.username,
'fakepword' : 'Password',
'passWord' : self.password,
'x' : '0',
'y' : '0',
}))
br.open(req).read()
return br


feeds = [(u'Latest News', u'http://www.screendaily.com/XmlServers/navsectionRSS.aspx?navsectioncode=3'), (u'Corporate News', u'http://www.screendaily.com/XmlServers/navsectionRSS.aspx?navsectioncode=115'), (u'Production News', u'http://www.screendaily.com/XmlServers/navsectionRSS.aspx?navsectioncode=279'), (u'In Focus', u'http://www.screendaily.com/XmlServers/navsectionRSS.aspx?navsectioncode=625'), (u'Opinion', u'http://www.screendaily.com/XmlServers/navsectionRSS.aspx?navsectioncode=669'), (u'Profiles', u'http://www.screendaily.com/XmlServers/navsectionRSS.aspx?navsectioncode=472'), (u'Market News', u'http://www.screendaily.com/XmlServers/navsectionRSS.aspx?navsectioncode=281'), (u'Analysis', u'http://www.screendaily.com/XmlServers/navsectionRSS.aspx?navsectioncode=624'), (u'Digital News', u'http://www.screendaily.com/XmlServers/navsectionRSS.aspx?navsectioncode=283')]
alexisvx is offline   Reply With Quote