"""Check if friendship exists"""
exists_friendship = bind_api(
path = '/friendships/exists.json',
- parser = parse_bool,
+ parser = parse_json,
allowed_param = ['user_a', 'user_b']
)
"""Get list of IDs of users the specified user is following"""
friends_ids = bind_api(
path = '/friends/ids.json',
- parser = parse_ids,
+ parser = parse_json,
allowed_param = ['id', 'user_id', 'screen_name', 'page']
)
"""Get list of IDs of users following the specified user"""
followers_ids = bind_api(
path = '/followers/ids.json',
- parser = parse_ids,
+ parser = parse_json,
allowed_param = ['id', 'user_id', 'screen_name', 'page']
)
try:
return bind_api(
path = '/account/verify_credentials.json',
- parser = parse_verify_credentials,
+ parser = parse_return_true,
require_auth = True)(self)
except TweepError:
return False
"""Rate limit status"""
rate_limit_status = bind_api(
path = '/account/rate_limit_status.json',
- parser = parse_rate_limit
+ parser = parse_json
)
"""Update delivery device"""
"""Get list of ids of users that are blocked"""
blocks_ids = bind_api(
path = '/blocks/blocking/ids.json',
- parser = parse_ids,
+ parser = parse_json,
require_auth = True
)
require_auth = True
)(self)
+ def test(self):
+ return bind_api(
+ path = '/help/test.json',
+ parser = parse_return_true
+ )(self)
+
saved_searches.append(_parse_saved_search(obj, api))
return saved_searches
-def parse_bool(data, api):
+def parse_json(data, api):
return json.loads(data)
-def parse_ids(data, api):
-
- return json.loads(data)
-
-def parse_verify_credentials(data, api):
+def parse_return_true(data, api):
return True
-def parse_rate_limit(data, api):
-
- return json.loads(data)
-
def parse_none(data, api):
return None