Howdy,
In the last few days my Twitter API calls started failing with this
error:
403 Forbidden: The server understood the request, but is refusing to
fulfill it. If you are posting from an API tool please ensure that the
HTTP_REFERER header is not set.
To my knowledge I'm not setting the referer. In my search of this
group it seemed all the posts related to referer were in 2007. My code
has been working since then so something changed. Anything changed on
the Twitter side? This code runs on Google AppEngine so I suppose it
could be something on their end. My guess is it is probable in GAE
because the code seems to work in their local test fixture, but I just
want to check.
Any thoughts on what might be happening or what I can do about it?
thanx
class SendChime(webapp.RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/plain'
username = self.request.get("username")
logging.debug("Sending chime for user=" + username)
login = username;
password = password"
chime = self.get_chime()
payload= {'status' : chime,
'source' : "innertwitter"}
payload= urllib.urlencode(payload)
base64string = base64.encodestring('%s:%s' % (login, password))
[:-1]
headers = {'Authorization': "Basic %s" % base64string}
url = "
http://twitter.com/statuses/update.xml"
result = urlfetch.fetch(url, payload=payload,
method=urlfetch.POST, headers=headers)
self.response.out.write(result.content)