From: Josh Roesslein Date: Mon, 6 Jul 2009 01:36:17 +0000 (-0500) Subject: Added update and destroy status endpoints. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=13570f580d06f37939cb8615f98d8a9cb9e302e6;p=tweepy.git Added update and destroy status endpoints. --- diff --git a/api.py b/api.py index 55280e3..55dacb7 100644 --- a/api.py +++ b/api.py @@ -55,4 +55,22 @@ class API(object): allowed_param = ['id'] ) + """Update status""" + update_status = bind_api( + path = '/statuses/update.json', + method = 'POST', + parser = parse_status, + allowed_param = ['status', 'in_reply_to_status_id'], + require_auth = True + ) + + """Destroy status""" + destroy_status = bind_api( + path = '/statuses/destroy.json', + method = 'DELETE', + parser = parse_status, + allowed_param = ['id'], + require_auth = True + ) + api = API('jitterapp', 'josh1987') diff --git a/binder.py b/binder.py index 8cd6380..143a13e 100644 --- a/binder.py +++ b/binder.py @@ -45,6 +45,10 @@ def bind_api(path, parser, allowed_param=None, method='GET', require_auth=False) raise TweepError(parse_error(resp.read())) # Pass returned body into parser and return parser output - return parser(resp.read(), api.classes) + out = parser(resp.read(), api.classes) + + # close connection and return data + conn.close() + return out return _call