Quote:
Originally Posted by der_joh
|
I have taken the script and played with it for quiet some time now. I couldn't figure out how to get it working.
I get a 401 error for the second last line. The
article.id doesn't seem to fit and I couldn't figure out how to get the right
id of the articles. article.id is in the form of
{'original-id': u'http://www.blogurl.com/?p=38615', 'gr:original-id': u'http://www.blogurl.com/?p=38615'}. Does this work or is the problem somewhere else?
PHP Code:
def build_request(self, url):
req = mechanize.Request(url)
req.add_header('Authorization', 'GoogleLogin auth=%s' % self.auth)
return req
def article_downloaded(self, request, result):
br = self.browser
req = self.build_request(self.mark_as_read_url)
if not result[2]:
# Mark article as downloaded.
article = request.article
fields = urllib.urlencode([("i", article.id), ("a", "user/-/state/com.google/read"),
("ac", "edit-tags"), ("T", self.token)])
br.open(self.mark_as_read_url, fields)
return BasicNewsRecipe.article_downloaded(self, request, result)