Commit 376eacb6 authored by Josh Roesslein's avatar Josh Roesslein
Browse files

Added account endpoints. Still need image update support.

parent 58fe28e8
......@@ -185,4 +185,48 @@ class API(object):
allowed_param = ['id', 'user_id', 'screen_name', 'page']
)
"""Verify credentials"""
verify_credentials = bind_api(
path = '/account/verify_credentials.json',
parser = parse_verify_credentials,
require_auth = True
)
"""Rate limit status"""
rate_limit_status = bind_api(
path = '/account/rate_limit_status.json',
parser = parse_rate_limit
)
"""Update delivery device"""
set_delivery_device = bind_api(
path = '/account/update_delivery_device.json',
method = 'POST',
allowed_param = ['device'],
parser = parse_user,
require_auth = True
)
"""Update profile colors"""
update_profile_colors = bind_api(
path = '/account/update_profile_colors.json',
method = 'POST',
parser = parse_user,
allowed_param = ['profile_background_color', 'profile_text_color',
'profile_link_color', 'profile_sidebar_fill_color',
'profile_sidebar_border_color'],
require_auth = True
)
# todo: add support for changing profile and background images
"""Update profile"""
update_profile = bind_api(
path = '/account/update_profile.json',
method = 'POST',
parser = parse_user,
allowed_param = ['name', 'email', 'url', 'location', 'description'],
require_auth = True
)
api = API('jitterapp', 'josh1987')
......@@ -14,6 +14,8 @@ def bind_api(path, parser, allowed_param=None, method='GET', require_auth=False)
# Filter out unallowed parameters
if allowed_param:
parameters = dict((k,v) for k,v in kargs.items() if k in allowed_param)
else:
parameters = None
# Open connection
if api.secure:
......
......@@ -108,3 +108,11 @@ def parse_bool(data, api):
def parse_ids(data, api):
return json.loads(data)
def parse_verify_credentials(data, api):
return True
def parse_rate_limit(data, api):
return json.loads(data)
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