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: Listobject
-
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:
-
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: Listobject
-
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: Trueif user is member of list,Falseotherwise
-
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: Trueif user is subscribed of list,Falseotherwise
-
list_members(list_id)¶ List users in a list
Parameters: list_id – list ID number Returns: list of Userobjects
-
list_subscribers(list_id)¶ List subscribers of a list
Parameters: list_id – list ID number Returns: Userobject
-
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
Tweetobjects
-
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: Listobject
-
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: Listobject
-
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
-