Authorize

Authorize to Twitter API

Arguments

Argument Type Default value Description
consumer_keystr, NoneNoneapp consumer key
consumer_secretstr, NoneNoneapp consumer secret
access_tokenstr, NoneNoneuser access token
access_token_secretstr, NoneNoneuser access token secret
param consumer_key:
 app consumer key
param consumer_secret:
 app consumer secret
param access_token:
 user access token
param access_token_secret:
 user access token secret

Follow

Follow Twitter user

Arguments

Argument Type Default value Description
userstr, NoneNonescreen name of the user
param user:screen name of the user
return:True if user was followed, False if not

Get Me

Get Twitter profile of authenticated user

return:user profile as dictionary or None

Get User Profile

Get user's Twitter profile

Arguments

Argument Type Default value Description
usernamestr, NoneNonewhose profile to get
param username:whose profile to get
return:profile as dictionary

Get User Tweets

Get user tweets

Arguments

Argument Type Default value Description
usernamestr, NoneNonewhose tweets to get
countint100maximum number of tweets, defaults to 100
param username:whose tweets to get
param count:maximum number of tweets, defaults to 100
return:list of user tweets

Like

Like a tweet

Arguments

Argument Type Default value Description
tweetTweet, NoneNoneas a class Tweet
param tweet:as a class Tweet
return:True if Tweet was liked, False if not

Text Search Tweets

Search tweets defined by search query

Arguments

Argument Type Default value Description
querystr, NoneNonesearch query string of 500 characters maximum, including operators
countint100maximum number of tweets, defaults to 100
geocodestr, NoneNonetweets by users located within a given radius of the given latitude/longitude
langstr, NoneNonelanguage code of tweets
localestr, NoneNonelanguage of the query you are sending
result_typestrmixedtype of search results you would prefer to receive, default "mixed"
untilstr, NoneNonetweets created before the given date
since_idstr, NoneNoneReturns only statuses with an ID greater than
max_idstr, NoneNoneonly statuses with an ID less than

Results types:

  • mixed : include both popular and real time results in the response
  • recent : return only the most recent results in the response
  • popular : return only the most popular results in the response
param query:search query string of 500 characters maximum, including operators
param count:maximum number of tweets, defaults to 100
param geocode:tweets by users located within a given radius of the given latitude/longitude
param lang:language code of tweets
param locale:language of the query you are sending
param result_type:
 type of search results you would prefer to receive, default "mixed"
param until:tweets created before the given date
param since_id:Returns only statuses with an ID greater than
param max_id:only statuses with an ID less than
return:list of matching tweets

Tweet

Make a tweet with content

Arguments

Argument Type Default value Description
contentstr, NoneNonetext for the status update
param content:text for the status update

Unfollow

Unfollow Twitter user

Arguments

Argument Type Default value Description
userstr, NoneNonescreen name of the user
param user:screen name of the user
return:True if user was followed, False if not

Unlike

Unlike a tweet

Arguments

Argument Type Default value Description
tweetTweet, NoneNoneas a class Tweet
param tweet:as a class Tweet
return:True if Tweet was unliked, False if not