From 13570f580d06f37939cb8615f98d8a9cb9e302e6 Mon Sep 17 00:00:00 2001 From: Josh Roesslein Date: Sun, 5 Jul 2009 20:36:17 -0500 Subject: [PATCH] Added update and destroy status endpoints. --- api.py | 18 ++++++++++++++++++ binder.py | 6 +++++- 2 files changed, 23 insertions(+), 1 deletion(-) 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 -- 2.25.1