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