'exclude_replies', 'include_entities'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/statuses/home_timeline.json',
allowed_param=['count', 'since_id', 'max_id', 'trim_user',
'exclude_replies', 'include_entities'],
kwargs['map'] = kwargs.pop('map_')
return bind_api(
- self, list_to_csv(id_), *args,
+ self, 'GET', list_to_csv(id_), *args,
path='/statuses/lookup.json',
allowed_param=['id', 'include_entities', 'trim_user', 'map',
'include_ext_alt_text', 'include_card_uri'],
'include_rts'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/statuses/user_timeline.json',
allowed_param=['user_id', 'screen_name', 'since_id', 'count',
'max_id', 'trim_user', 'exclude_replies',
:allowed_param: 'since_id', 'max_id', 'count'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/statuses/mentions_timeline.json',
allowed_param=['since_id', 'max_id', 'count'],
require_auth=True, **kwargs
:allowed_param: 'since_id', 'max_id', 'count'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/statuses/retweets_of_me.json',
allowed_param=['since_id', 'max_id', 'count'],
require_auth=True, **kwargs
'include_card_uri'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/statuses/show.json',
allowed_param=['id', 'trim_user', 'include_my_retweet',
'include_entities', 'include_ext_alt_text',
kwargs['media_ids'] = list_to_csv(kwargs['media_ids'])
return bind_api(
- self, *args,
+ self, 'POST', *args,
path='/statuses/update.json',
- method='POST',
allowed_param=['status', 'in_reply_to_status_id',
'auto_populate_reply_metadata',
'exclude_reply_user_ids', 'attachment_url',
kwargs.update({'headers': headers, 'post_data': post_data})
return bind_api(
- self, *args,
+ self, 'POST', *args,
path='/media/upload.json',
- method='POST',
allowed_param=[],
require_auth=True,
upload_api=True, **kwargs
}
return bind_api(
- self, *args,
+ self, 'POST', *args,
path='/media/metadata/create.json',
- method='POST',
allowed_param=[],
require_auth=True,
upload_api=True, **kwargs
kwargs.update({'headers': headers, 'post_data': post_data})
return bind_api(
- self, *args,
+ self, 'POST', *args,
path='/statuses/update_with_media.json',
- method='POST',
allowed_param=['status', 'possibly_sensitive',
'in_reply_to_status_id',
'in_reply_to_status_id_str',
:allowed_param:
"""
return bind_api(
- self, *args,
+ self, 'POST', *args,
path=f'/statuses/destroy/{status_id}.json',
- method='POST',
require_auth=True, **kwargs
)
:allowed_param:
"""
return bind_api(
- self, *args,
+ self, 'POST', *args,
path=f'/statuses/retweet/{status_id}.json',
- method='POST',
require_auth=True, **kwargs
)
:allowed_param:
"""
return bind_api(
- self, *args,
+ self, 'POST', *args,
path=f'/statuses/unretweet/{status_id}.json',
- method='POST',
require_auth=True, **kwargs
)
:allowed_param: 'count'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path=f'/statuses/retweets/{status_id}.json',
allowed_param=['count'],
require_auth=True, **kwargs
:allowed_param: 'id', 'cursor', 'stringify_ids
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/statuses/retweeters/ids.json',
allowed_param=['id', 'cursor', 'stringify_ids'], **kwargs
)
:allowed_param: 'id', 'user_id', 'screen_name'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/users/show.json',
allowed_param=['id', 'user_id', 'screen_name'], **kwargs
)
'link_color', 'widget_type', 'dnt'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/statuses/oembed.json',
allowed_param=['url', 'maxwidth', 'hide_media', 'hide_thread',
'omit_script', 'align', 'related', 'lang', 'theme',
'tweet_mode'
"""
return bind_api(
- self, list_to_csv(user_ids), list_to_csv(screen_names), *args,
+ self, 'POST', list_to_csv(user_ids), list_to_csv(screen_names),
+ *args,
path='/users/lookup.json',
- method='POST',
allowed_param=['user_id', 'screen_name', 'include_entities',
'tweet_mode'], **kwargs
)
:allowed_param: 'q', 'count', 'page'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/users/search.json',
require_auth=True,
allowed_param=['q', 'count', 'page'], **kwargs
:allowed_param: 'id'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/direct_messages/events/show.json',
allowed_param=['id'],
require_auth=True, **kwargs
:allowed_param: 'count', 'cursor'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/direct_messages/events/list.json',
allowed_param=['count', 'cursor'],
require_auth=True, **kwargs
if ctas is not None:
message_data['ctas'] = ctas
return bind_api(
- self,
+ self, 'POST',
path='/direct_messages/events/new.json',
- method='POST',
require_auth=True,
json_payload=json_payload, **kwargs
)
:allowed_param: 'id'
"""
return bind_api(
- self, *args,
+ self, 'DELETE', *args,
path='/direct_messages/events/destroy.json',
- method='DELETE',
allowed_param=['id'],
require_auth=True, **kwargs
)
:allowed_param: 'id', 'user_id', 'screen_name', 'follow'
"""
return bind_api(
- self, *args,
+ self, 'POST', *args,
path='/friendships/create.json',
- method='POST',
allowed_param=['id', 'user_id', 'screen_name', 'follow'],
require_auth=True, **kwargs
)
:allowed_param: 'id', 'user_id', 'screen_name'
"""
return bind_api(
- self, *args,
+ self, 'POST', *args,
path='/friendships/destroy.json',
- method='POST',
allowed_param=['id', 'user_id', 'screen_name'],
require_auth=True, **kwargs
)
'target_screen_name'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/friendships/show.json',
allowed_param=['source_id', 'source_screen_name',
'target_id', 'target_screen_name'], **kwargs
:allowed_param: 'user_id', 'screen_name'
"""
return bind_api(
- self, list_to_csv(user_ids), list_to_csv(screen_names),
+ self, 'GET', list_to_csv(user_ids), list_to_csv(screen_names),
path='/friendships/lookup.json',
allowed_param=['user_id', 'screen_name'],
require_auth=True, **kwargs
:allowed_param: 'id', 'user_id', 'screen_name', 'cursor'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/friends/ids.json',
allowed_param=['id', 'user_id', 'screen_name', 'cursor'], **kwargs
)
'skip_status', 'include_user_entities'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/friends/list.json',
allowed_param=['id', 'user_id', 'screen_name', 'cursor', 'count',
'skip_status', 'include_user_entities'], **kwargs
:allowed_param: 'cursor'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/friendships/incoming.json',
allowed_param=['cursor'], **kwargs
)
:allowed_param: 'cursor'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/friendships/outgoing.json',
allowed_param=['cursor'], **kwargs
)
:allowed_param: 'id', 'user_id', 'screen_name', 'cursor', 'count'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/followers/ids.json',
allowed_param=['id', 'user_id', 'screen_name', 'cursor', 'count'],
**kwargs
'skip_status', 'include_user_entities'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/followers/list.json',
allowed_param=['id', 'user_id', 'screen_name', 'cursor', 'count',
'skip_status', 'include_user_entities'], **kwargs
def get_settings(self, *args, **kwargs):
""" :reference: https://developer.twitter.com/en/docs/accounts-and-users/manage-account-settings/api-reference/get-account-settings """
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/account/settings.json',
use_cache=False, **kwargs
)
'allow_contributor_request', 'lang'
"""
return bind_api(
- self, *args,
+ self, 'POST', *args,
path='/account/settings.json',
- method='POST',
allowed_param=['sleep_time_enabled', 'start_sleep_time',
'end_sleep_time', 'time_zone',
'trend_location_woeid',
kwargs['include_email'] = str(kwargs['include_email']).lower()
try:
return bind_api(
- self,
+ self, 'GET',
path='/account/verify_credentials.json',
require_auth=True,
allowed_param=['include_entities', 'skip_status',
:allowed_param: 'resources'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/application/rate_limit_status.json',
allowed_param=['resources'],
use_cache=False, **kwargs
"""
headers, post_data = API._pack_image(filename, 700, f=file_)
return bind_api(
- self,
+ self, 'POST', *args,
path='/account/update_profile_image.json',
- method='POST',
allowed_param=['include_entities', 'skip_status'],
require_auth=True,
post_data=post_data, headers=headers, **kwargs
headers, post_data = API._pack_image(filename, 700,
form_field='banner', f=f)
return bind_api(
- self,
+ self, 'POST',
path='/account/update_profile_banner.json',
- method='POST',
allowed_param=['width', 'height', 'offset_left', 'offset_right'],
require_auth=True,
post_data=post_data, headers=headers
'profile_link_color'
"""
return bind_api(
- self, *args,
+ self, 'POST', *args,
path='/account/update_profile.json',
- method='POST',
allowed_param=['name', 'url', 'location', 'description',
'profile_link_color'],
require_auth=True, **kwargs
'since_id'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/favorites/list.json',
allowed_param=['screen_name', 'user_id', 'max_id', 'count',
'since_id'], **kwargs
:allowed_param: 'id'
"""
return bind_api(
- self, *args,
+ self, 'POST', *args,
path='/favorites/create.json',
- method='POST',
allowed_param=['id'],
require_auth=True, **kwargs
)
:allowed_param: 'id'
"""
return bind_api(
- self, *args,
+ self, 'POST', *args,
path='/favorites/destroy.json',
- method='POST',
allowed_param=['id'],
require_auth=True, **kwargs
)
:allowed_param: 'id', 'user_id', 'screen_name'
"""
return bind_api(
- self, *args,
+ self, 'POST', *args,
path='/blocks/create.json',
- method='POST',
allowed_param=['id', 'user_id', 'screen_name'],
require_auth=True, **kwargs
)
:allowed_param: 'id', 'user_id', 'screen_name'
"""
return bind_api(
- self, *args,
+ self, 'POST', *args,
path='/blocks/destroy.json',
- method='POST',
allowed_param=['id', 'user_id', 'screen_name'],
require_auth=True, **kwargs
)
:allowed_param: 'cursor'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/mutes/users/ids.json',
allowed_param=['cursor'],
require_auth=True, **kwargs
:allowed_param: 'cursor', 'include_entities', 'skip_status'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/mutes/users/list.json',
allowed_param=['cursor', 'include_entities', 'skip_status'],
required_auth=True, **kwargs
:allowed_param: 'id', 'user_id', 'screen_name'
"""
return bind_api(
- self, *args,
+ self, 'POST', *args,
path='/mutes/users/create.json',
- method='POST',
allowed_param=['id', 'user_id', 'screen_name'],
require_auth=True, **kwargs
)
:allowed_param: 'id', 'user_id', 'screen_name'
"""
return bind_api(
- self, *args,
+ self, 'POST', *args,
path='/mutes/users/destroy.json',
- method='POST',
allowed_param=['id', 'user_id', 'screen_name'],
require_auth=True, **kwargs
)
:allowed_param: 'cursor'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/blocks/list.json',
allowed_param=['cursor'],
require_auth=True, **kwargs
:allowed_param: 'cursor'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/blocks/ids.json',
allowed_param=['cursor'],
require_auth=True, **kwargs
:allowed_param: 'user_id', 'screen_name', 'perform_block'
"""
return bind_api(
- self, *args,
+ self, 'POST', *args,
path='/users/report_spam.json',
- method='POST',
allowed_param=['user_id', 'screen_name', 'perform_block'],
require_auth=True, **kwargs
)
def saved_searches(self, *args, **kwargs):
""" :reference: https://developer.twitter.com/en/docs/accounts-and-users/manage-account-settings/api-reference/get-saved_searches-list """
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/saved_searches/list.json',
require_auth=True, **kwargs
)
:allowed_param:
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path=f'/saved_searches/show/{saved_search_id}.json',
require_auth=True, **kwargs
)
:allowed_param: 'query'
"""
return bind_api(
- self, *args,
+ self, 'POST', *args,
path='/saved_searches/create.json',
- method='POST',
allowed_param=['query'],
require_auth=True, **kwargs
)
:allowed_param:
"""
return bind_api(
- self, *args,
+ self, 'POST', *args,
path=f'/saved_searches/destroy/{saved_search_id}.json',
- method='POST',
require_auth=True, **kwargs
)
:allowed_param: 'name', 'mode', 'description'
"""
return bind_api(
- self, *args,
+ self, 'POST', *args,
path='/lists/create.json',
- method='POST',
allowed_param=['name', 'mode', 'description'],
require_auth=True, **kwargs
)
:allowed_param: 'owner_screen_name', 'owner_id', 'list_id', 'slug'
"""
return bind_api(
- self, *args,
+ self, 'POST', *args,
path='/lists/destroy.json',
- method='POST',
allowed_param=['owner_screen_name', 'owner_id', 'list_id', 'slug'],
require_auth=True, **kwargs
)
'owner_screen_name', 'owner_id'
"""
return bind_api(
- self, *args,
+ self, 'POST', *args,
path='/lists/update.json',
- method='POST',
allowed_param=['list_id', 'slug', 'name', 'mode', 'description',
'owner_screen_name', 'owner_id'],
require_auth=True, **kwargs
:allowed_param: 'screen_name', 'user_id', 'reverse'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/lists/list.json',
allowed_param=['screen_name', 'user_id', 'reverse'],
require_auth=True, **kwargs
'cursor', 'count'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/lists/memberships.json',
allowed_param=['screen_name', 'user_id', 'filter_to_owned_lists',
'cursor', 'count'],
:allowed_param: 'user_id', 'screen_name', 'count', 'cursor'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/lists/ownerships.json',
allowed_param=['user_id', 'screen_name', 'count', 'cursor'],
require_auth=True, **kwargs
:allowed_param: 'screen_name', 'user_id', 'cursor', 'count'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/lists/subscriptions.json',
allowed_param=['screen_name', 'user_id', 'cursor', 'count'],
require_auth=True, **kwargs
'include_rts'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/lists/statuses.json',
allowed_param=['owner_screen_name', 'slug', 'owner_id', 'list_id',
'since_id', 'max_id', 'count', 'include_entities',
:allowed_param: 'owner_screen_name', 'owner_id', 'slug', 'list_id'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/lists/show.json',
allowed_param=['owner_screen_name', 'owner_id', 'slug', 'list_id'],
**kwargs
'owner_id', 'slug', 'list_id'
"""
return bind_api(
- self, *args,
+ self, 'POST', *args,
path='/lists/members/create.json',
- method='POST',
allowed_param=['screen_name', 'user_id', 'owner_screen_name',
'owner_id', 'slug', 'list_id'],
require_auth=True, **kwargs
'owner_id', 'slug', 'list_id'
"""
return bind_api(
- self, *args,
+ self, 'POST', *args,
path='/lists/members/destroy.json',
- method='POST',
allowed_param=['screen_name', 'user_id', 'owner_screen_name',
'owner_id', 'slug', 'list_id'],
require_auth=True, **kwargs
'owner_id', 'owner_screen_name'
"""
return bind_api(
- self, list_to_csv(screen_name), list_to_csv(user_id), slug,
+ self, 'POST', list_to_csv(screen_name), list_to_csv(user_id), slug,
list_id, owner_id, owner_screen_name,
path='/lists/members/create_all.json',
- method='POST',
allowed_param=['screen_name', 'user_id', 'slug', 'list_id',
'owner_id', 'owner_screen_name'],
require_auth=True, **kwargs
'owner_id', 'owner_screen_name'
"""
return bind_api(
- self, list_to_csv(screen_name), list_to_csv(user_id), slug,
+ self, 'POST', list_to_csv(screen_name), list_to_csv(user_id), slug,
list_id, owner_id, owner_screen_name,
path='/lists/members/destroy_all.json',
- method='POST',
allowed_param=['screen_name', 'user_id', 'slug', 'list_id',
'owner_id', 'owner_screen_name'],
require_auth=True, **kwargs
'cursor'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/lists/members.json',
allowed_param=['owner_screen_name', 'slug', 'list_id', 'owner_id',
'cursor'], **kwargs
'owner_screen_name', 'owner_id'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/lists/members/show.json',
allowed_param=['list_id', 'slug', 'user_id', 'screen_name',
'owner_screen_name', 'owner_id'], **kwargs
:allowed_param: 'owner_screen_name', 'slug', 'owner_id', 'list_id'
"""
return bind_api(
- self, *args,
+ self, 'POST', *args,
path='/lists/subscribers/create.json',
- method='POST',
allowed_param=['owner_screen_name', 'slug', 'owner_id', 'list_id'],
require_auth=True, **kwargs
)
:allowed_param: 'owner_screen_name', 'slug', 'owner_id', 'list_id'
"""
return bind_api(
- self, *args,
+ self, 'POST', *args,
path='/lists/subscribers/destroy.json',
- method='POST',
allowed_param=['owner_screen_name', 'slug', 'owner_id', 'list_id'],
require_auth=True, **kwargs
)
'skip_status'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/lists/subscribers.json',
allowed_param=['owner_screen_name', 'slug', 'owner_id', 'list_id',
'cursor', 'count', 'include_entities',
'owner_id', 'list_id', 'user_id'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/lists/subscribers/show.json',
allowed_param=['owner_screen_name', 'slug', 'screen_name',
'owner_id', 'list_id', 'user_id'], **kwargs
def trends_available(self, *args, **kwargs):
""" :reference: https://developer.twitter.com/en/docs/trends/locations-with-trending-topics/api-reference/get-trends-available """
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/trends/available.json',
**kwargs
)
:allowed_param: 'id', 'exclude'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/trends/place.json',
allowed_param=['id', 'exclude'], **kwargs
)
:allowed_param: 'lat', 'long'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/trends/closest.json',
allowed_param=['lat', 'long'], **kwargs
)
'include_entities'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/search/tweets.json',
allowed_param=['q', 'lang', 'locale', 'since_id', 'geocode',
'max_id', 'until', 'result_type', 'count',
'next'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path=f'/tweets/search/30day/{environment_name}.json',
allowed_param=['query', 'tag', 'fromDate', 'toDate', 'maxResults',
'next'],
'next'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path=f'/tweets/search/fullarchive/{environment_name}.json',
allowed_param=['query', 'tag', 'fromDate', 'toDate', 'maxResults',
'next'],
'max_results'
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/geo/reverse_geocode.json',
allowed_param=['lat', 'long', 'accuracy', 'granularity',
'max_results'], **kwargs
:allowed_param:
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path=f'/geo/id/{place_id}.json',
**kwargs
)
"""
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/geo/search.json',
allowed_param=['lat', 'long', 'query', 'ip', 'granularity',
'accuracy', 'max_results', 'contained_within'],
def supported_languages(self, *args, **kwargs):
""" :reference: https://developer.twitter.com/en/docs/developer-utilities/supported-languages/api-reference/get-help-languages """
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/help/languages.json',
require_auth=True, **kwargs
)
def configuration(self, *args, **kwargs):
""" :reference: https://developer.twitter.com/en/docs/developer-utilities/configuration/api-reference/get-help-configuration """
return bind_api(
- self, *args,
+ self, 'GET', *args,
path='/help/configuration.json',
require_auth=True, **kwargs
)