Commit 13570f58 authored by Josh Roesslein's avatar Josh Roesslein
Browse files

Added update and destroy status endpoints.

parent 543ac3b6
......@@ -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')
......@@ -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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment