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
|
||||
try:
|
||||
return simplejson.load(self.opener.open("http://api.twitter.com/%d/statuses/update.json?" % version, urllib.urlencode({
|
||||
"status": self.unicode2utf8(status),
|
||||
"in_reply_to_status_id": in_reply_to_status_id,
|
||||
"lat": latitude,
|
||||
"long": longitude
|
||||
})))
|
||||
postExt = urllib.urlencode({"status": self.unicode2utf8(status)})
|
||||
if latitude is not None and longitude is not None:
|
||||
postExt += "&lat=%s&long=%s" % (latitude, longitude)
|
||||
if in_reply_to_status_id is not None:
|
||||
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:
|
||||
raise TwythonError("updateStatus() failed with a %s error code." % `e.code`, e.code)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue