checkIfFriendshipExists() was previously throwing a POST, when it should've been doing a GET request. Up until this point, it would have returned HTTP 400 errors on all calls - fixed now (both Twython2k and Twython3k). Thanks to Risto Haukioja for pointing this out to me. ;)

This commit is contained in:
Ryan McGrath 2009-09-01 02:11:46 -04:00
parent 80bc6f9fd0
commit 8f975506d5
2 changed files with 11 additions and 9 deletions

View file

@ -275,7 +275,7 @@ class setup:
"""
if self.authenticated is True:
try:
return simplejson.load(self.opener.open("http://twitter.com/statuses/retweet/%s.json", "POST" % id))
return simplejson.load(self.opener.open("http://twitter.com/statuses/retweet/%s.json" % `id`, "POST"))
except HTTPError, e:
raise TwythonError("reTweet() failed with a %s error code." % `e.code`, e.code)
else:
@ -672,7 +672,8 @@ class setup:
"""
if self.authenticated is True:
try:
return simplejson.load(self.opener.open("http://twitter.com/friendships/exists.json", urllib.urlencode({"user_a": user_a, "user_b": user_b})))
friendshipURL = "http://twitter.com/friendships/exists.json?%s" % urllib.urlencode({"user_a": user_a, "user_b": user_b})
return simplejson.load(self.opener.open(friendshipURL))
except HTTPError, e:
raise TwythonError("checkIfFriendshipExists() failed with a %s error code." % `e.code`, e.code)
else: