Don't pass odd null parameters for updateStatus(), Twitter has seemingly decided to barf on them
This commit is contained in:
parent
a1bd6bfb85
commit
0e878ce75d
1 changed files with 6 additions and 6 deletions
|
|
@ -586,12 +586,12 @@ class setup:
|
||||||
"""
|
"""
|
||||||
version = version or self.apiVersion
|
version = version or self.apiVersion
|
||||||
try:
|
try:
|
||||||
return simplejson.load(self.opener.open("http://api.twitter.com/%d/statuses/update.json?" % version, urllib.urlencode({
|
postExt = urllib.urlencode({"status": self.unicode2utf8(status)})
|
||||||
"status": self.unicode2utf8(status),
|
if latitude is not None and longitude is not None:
|
||||||
"in_reply_to_status_id": in_reply_to_status_id,
|
postExt += "&lat=%s&long=%s" % (latitude, longitude)
|
||||||
"lat": latitude,
|
if in_reply_to_status_id is not None:
|
||||||
"long": longitude
|
postExt += "&in_reply_to_status_id=%s" % `in_reply_to_status_id`
|
||||||
})))
|
return simplejson.load(self.opener.open("http://api.twitter.com/%d/statuses/update.json?" % version, postExt))
|
||||||
except HTTPError, e:
|
except HTTPError, e:
|
||||||
raise TwythonError("updateStatus() failed with a %s error code." % `e.code`, e.code)
|
raise TwythonError("updateStatus() failed with a %s error code." % `e.code`, e.code)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue