from binder import bind_api
from parsers import *
from models import User, Status, DirectMessage, Friendship
+from error import TweepError
"""Twitter API"""
class API(object):
)
"""Verify credentials"""
- verify_credentials = bind_api(
- path = '/account/verify_credentials.json',
- parser = parse_verify_credentials,
- require_auth = True
- )
+ def verify_credentials(self):
+ try:
+ return bind_api(
+ path = '/account/verify_credentials.json',
+ parser = parse_verify_credentials,
+ require_auth = True)(self)
+ except TweepError:
+ return False
"""Rate limit status"""
rate_limit_status = bind_api(
allowed_param = ['id'],
require_auth = True
)
-
-api = API('jitterapp', 'josh1987')