responsebot.responsebot_client

Classes

ResponseBotClient(client, config) Wrapper for all Twitter API clients.
class responsebot.responsebot_client.ResponseBotClient(client, config)

Wrapper for all Twitter API clients.

add_list_member(list_id, user_id)

Add a user to list

Parameters:
  • list_id – list ID number
  • user_id – user ID number
Returns:

List object

create_list(name, mode='public', description=None)

Create a list

Parameters:
  • name – Name of the new list
  • mode'public' (default) or 'private'
  • description – Description of the new list
Returns:

The new list object

Return type:

List

destroy_list(list_id)

Destroy a list

Parameters:list_id – list ID number
Returns:The destroyed list object
Return type:List
follow(user_id, notify=False)

Follow a user.

Parameters:
  • user_id – ID of the user in question
  • notify – whether to notify the user about the following
Returns:

user that are followed

get_list(list_id)

Get info of specified list

Parameters:list_id – list ID number
Returns:List object
get_tweet(id)

Get an existing tweet.

Parameters:id – ID of the tweet in question
Returns:Tweet object. None if not found
get_user(id)

Get a user’s info.

Parameters:id – ID of the user in question
Returns:User object. None if not found
is_list_member(list_id, user_id)

Check if a user is member of a list

Parameters:
  • list_id – list ID number
  • user_id – user ID number
Returns:

True if user is member of list, False otherwise

is_subscribed_list(list_id, user_id)

Check if user is a subscribed of specified list

Parameters:
  • list_id – list ID number
  • user_id – user ID number
Returns:

True if user is subscribed of list, False otherwise

list_members(list_id)

List users in a list

Parameters:list_id – list ID number
Returns:list of User objects
list_subscribers(list_id)

List subscribers of a list

Parameters:list_id – list ID number
Returns:User object
list_timeline(list_id, since_id=None, max_id=None, count=20)

List the tweets of specified list.

Parameters:
  • list_id – list ID number
  • since_id – results will have ID greater than specified ID (more recent than)
  • max_id – results will have ID less than specified ID (older than)
  • count – number of results per page
Returns:

list of Tweet objects

lists()

List user’s lists

Returns:list of List objects
lists_memberships()

List lists which user was added

Returns:list of List objects
lists_subscriptions()

List lists which user followed

Returns:list of List objects
remove_list_member(list_id, user_id)

Remove a user from a list

Parameters:
  • list_id – list ID number
  • user_id – user ID number
Returns:

List object

remove_tweet(id)

Delete a tweet.

Parameters:id – ID of the tweet in question
Returns:True if success, False otherwise
retweet(id)

Retweet a tweet.

Parameters:id – ID of the tweet in question
Returns:True if success, False otherwise
subscribe_list(list_id)

Subscribe to a list

Parameters:list_id – list ID number
Returns:List object
tweepy_api

Get the actual client object.

Returns:the actual client object
tweet(text, in_reply_to=None, filename=None, file=None)

Post a new tweet.

Parameters:
  • text – the text to post
  • in_reply_to – The ID of the tweet to reply to
  • filename – If file param is not provided, read file from this path
  • file – A file object, which will be used instead of opening filename. filename is still required, for

MIME type detection and to use as a form field in the POST data :return: Tweet object

unfollow(user_id)

Follow a user.

Parameters:user_id – ID of the user in question
Returns:The user that were unfollowed
unsubscribe_list(list_id)

Unsubscribe to a list

Parameters:list_id – list ID number
Returns:List object
update_list(list_id, name=None, mode=None, description=None)

Update a list

Parameters:
  • list_id – list ID number
  • name – New name for the list
  • mode'public' (default) or 'private'
  • description – New description of the list
Returns:

The updated list object

Return type:

List