twitter4j
Class AsyncTwitter

java.lang.Object
  extended by twitter4j.TwitterBase
      extended by twitter4j.TwitterOAuthSupportBase
          extended by twitter4j.AsyncTwitter
All Implemented Interfaces:
java.io.Serializable, AccountMethodsAsync, BlockMethodsAsync, DirectMessageMethodsAsync, FavoriteMethodsAsync, FriendshipMethodsAsync, HelpMethodsAsync, ListMembersMethodsAsync, ListMethodsAsync, ListSubscribersMethodsAsync, LocalTrendsMethodsAsync, NotificationMethodsAsync, SavedSearchesMethodsAsync, SearchMethodsAsync, SocialGraphMethodsAsync, SpamReportingMethodsAsync, StatusMethodsAsync, TimelineMethodsAsync, UserMethodsAsync, HttpResponseListener, OAuthSupport

public class AsyncTwitter
extends TwitterOAuthSupportBase
implements java.io.Serializable, SearchMethodsAsync, TimelineMethodsAsync, StatusMethodsAsync, UserMethodsAsync, ListMethodsAsync, ListMembersMethodsAsync, ListSubscribersMethodsAsync, DirectMessageMethodsAsync, FriendshipMethodsAsync, SocialGraphMethodsAsync, AccountMethodsAsync, FavoriteMethodsAsync, NotificationMethodsAsync, BlockMethodsAsync, SpamReportingMethodsAsync, SavedSearchesMethodsAsync, LocalTrendsMethodsAsync, HelpMethodsAsync

Twitter API with a series of asynchronous APIs.
With this class, you can call TwitterAPI asynchronously.
Note that currently this class is NOT compatible with Google App Engine as it is maintaining threads internally.

Author:
Yusuke Yamamoto - yusuke at mac.com
See Also:
AsyncTwitter, TwitterListener, Serialized Form

Nested Class Summary
(package private)  class AsyncTwitter.AsyncTask
           
 
Field Summary
private static Dispatcher dispatcher
           
private  TwitterListener listener
           
private static long serialVersionUID
           
private  boolean shutdown
           
private  Twitter twitter
           
 
Fields inherited from class twitter4j.TwitterOAuthSupportBase
http, rateLimitStatusListener
 
Fields inherited from class twitter4j.TwitterBase
auth, conf
 
Constructor Summary
AsyncTwitter(Configuration conf, Authorization auth, TwitterListener listener)
           
AsyncTwitter(java.lang.String screenName, java.lang.String password, TwitterListener listener)
          Deprecated. use new AsyncTwitterFactory.getBasicAuthorizedInstance() instead.
 
Method Summary
 void createBlock(java.lang.String screenName)
          Blocks the user specified in the ID parameter as the authenticating user.
 void createBlockAsync(int userId)
          Blocks the user specified in the ID parameter as the authenticating user.
 void createFavorite(long id)
          Favorites the status specified in the ID parameter as the authenticating user.
 void createFriendship(int userId)
          Befriends the user specified in the ID parameter as the authenticating user.
 void createFriendship(int userId, boolean follow)
          Befriends the user specified in the ID parameter as the authenticating user.
 void createFriendship(java.lang.String screenName)
          Befriends the user specified in the ID parameter as the authenticating user.
 void createFriendship(java.lang.String screenName, boolean follow)
          Befriends the user specified in the ID parameter as the authenticating user.
 void destroyBlock(int userId)
          Un-blocks the user specified in the ID parameter as the authenticating user.
 void destroyBlock(java.lang.String screenName)
          Un-blocks the user specified in the ID parameter as the authenticating user.
 void destroyDirectMessage(int id)
          Delete specified direct message
This method calls http://api.twitter.com/1/direct_messages/destroy
 void destroyFavorite(long id)
          Favorites the status specified in the ID parameter as the authenticating user.
 void destroyFriendship(int userId)
          Discontinues friendship with the specified in the ID parameter as the authenticating user.
 void destroyFriendship(java.lang.String screenName)
          Discontinues friendship with the specified in the ID parameter as the authenticating user.
 void destroyStatus(long statusId)
          Destroys the status specified by the required ID parameter.
 void disableNotification(int userId)
          Disables notifications for updates from the specified user to the authenticating user.
 void disableNotification(java.lang.String screenName)
          Disables notifications for updates from the specified user to the authenticating user.
 void enableNotification(int userId)
          Enables notifications for updates from the specified user to the authenticating user.
 void enableNotification(java.lang.String screenName)
          Enables notifications for updates from the specified user to the authenticating user.
 void existsBlock(int userId)
          Tests if a friendship exists between two users.
 void existsBlock(java.lang.String screenName)
          Tests if a friendship exists between two users.
 void existsFriendship(java.lang.String userA, java.lang.String userB)
          Tests if a friendship exists between two users.
 void getBlockingUsers()
          Returns a list of user objects that the authenticating user is blocking.
 void getBlockingUsers(int page)
          Returns a list of user objects that the authenticating user is blocking.
 void getBlockingUsersIDs()
          Returns an array of numeric user ids the authenticating user is blocking.
 void getCurrentTrends()
          Returns the current top 10 trending topics on Twitter.
 void getCurrentTrends(boolean excludeHashTags)
          Returns the current top 10 trending topics on Twitter.
 void getDailyTrends()
          Returns the top 20 trending topics for each hour in a given day.
 void getDailyTrends(java.util.Date date, boolean excludeHashTags)
          Returns the top 20 trending topics for each hour in a given day.
 void getDirectMessages()
          Returns a list of the direct messages sent to the authenticating user.
 void getDirectMessages(Paging paging)
          Returns a list of the direct messages sent to the authenticating user.
private  Dispatcher getDispatcher()
           
 void getFavorites()
          Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.
 void getFavorites(int page)
          Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.
 void getFavorites(java.lang.String id)
          Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.
 void getFavorites(java.lang.String id, int page)
          Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.
 void getFollowersIDs()
          Returns an array of numeric IDs for every user the specified user is followed by.
 void getFollowersIDs(int userId)
          Returns an array of numeric IDs for every user the specified user is followed by.
 void getFollowersIDs(int userId, long cursor)
          Returns an array of numeric IDs for every user the specified user is followed by.
 void getFollowersIDs(long cursor)
          Returns an array of numeric IDs for every user the specified user is followed by.
 void getFollowersIDs(java.lang.String screenName)
          Returns an array of numeric IDs for every user the specified user is followed by.
 void getFollowersIDs(java.lang.String screenName, long cursor)
          Returns an array of numeric IDs for every user the specified user is followed by.
 void getFollowersStatuses()
          Returns the authenticating user's followers, each with current status inline.
 void getFollowersStatuses(int userId)
          Returns the specified user's followers, each with current status inline.
 void getFollowersStatuses(int userId, long cursor)
          Returns the specified user's followers, each with current status inline.
 void getFollowersStatuses(long cursor)
          Returns the authenticating user's followers, each with current status inline.
 void getFollowersStatuses(java.lang.String screenName)
          Returns the specified user's followers, each with current status inline.
 void getFollowersStatuses(java.lang.String screenName, long cursor)
          Returns the specified user's followers, each with current status inline.
 void getFriendsIDs()
          Returns an array of numeric IDs for every user the authenticating user is following.
 void getFriendsIDs(int userId)
          Returns an array of numeric IDs for every user the specified user is following.
 void getFriendsIDs(int userId, long cursor)
          Returns an array of numeric IDs for every user the specified user is following.
 void getFriendsIDs(long cursor)
          Returns an array of numeric IDs for every user the authenticating user is following.
 void getFriendsIDs(java.lang.String screenName)
          Returns an array of numeric IDs for every user the specified user is following.
 void getFriendsIDs(java.lang.String screenName, long cursor)
          Returns an array of numeric IDs for every user the specified user is following.
 void getFriendsStatuses()
          Returns the specified user's friends, each with current status inline.
 void getFriendsStatuses(int userId)
          Returns the specified user's friends, each with current status inline.
 void getFriendsStatuses(int userId, long cursor)
          Returns the specified user's friends, each with current status inline.
 void getFriendsStatuses(long cursor)
          Returns the specified user's friends, each with current status inline.
 void getFriendsStatuses(java.lang.String screenName)
          Returns the specified user's friends, each with current status inline.
 void getFriendsStatuses(java.lang.String screenName, long cursor)
          Returns the specified user's friends, each with current status inline.
 void getFriendsTimeline()
          Returns the 20 most recent statuses posted in the last 24 hours from the authenticating user and that user's friends.
 void getFriendsTimeline(Paging paging)
          Returns the 20 most recent statuses posted in the last 24 hours from the authenticating user and that user's friends.
 void getHomeTimeline()
          Returns the 20 most recent statuses, including retweets, posted by the authenticating user and that user's friends.
 void getHomeTimeline(Paging paging)
          Returns the 20 most recent statuses, including retweets, posted by the authenticating user and that user's friends.
 void getMentions()
          Returns the 20 most recent replies (status updates prefixed with @username) to the authenticating user.
 void getMentions(Paging paging)
          Returns the 20 most recent replies (status updates prefixed with @username) to the authenticating user.
 AccessToken getOAuthAccessToken()
          Retrieves an access token.
 AccessToken getOAuthAccessToken(RequestToken requestToken)
          Retrieves an access token associated with the supplied request token and sets userId.
 AccessToken getOAuthAccessToken(RequestToken requestToken, java.lang.String oauthVerifier)
          Retrieves an access token associated with the supplied request token and sets userId.
 AccessToken getOAuthAccessToken(java.lang.String oauthVerifier)
          Retrieves an access token.
 AccessToken getOAuthAccessToken(java.lang.String token, java.lang.String tokenSecret)
           
 AccessToken getOAuthAccessToken(java.lang.String token, java.lang.String tokenSecret, java.lang.String pin)
          Retrieves an access token associated with the supplied request token.
 RequestToken getOAuthRequestToken()
          Retrieves a request token
 RequestToken getOAuthRequestToken(java.lang.String callbackUrl)
          Retrieves a request token
 void getPublicTimeline()
          Returns the 20 most recent statuses from non-protected users who have set a custom user icon.
 void getRateLimitStatus()
          Gets the remaining number of API requests available to the requesting user before the API limit is reached for the current hour.
 void getRetweetedByMe()
          Returns the 20 most recent retweets posted by the authenticating user.
 void getRetweetedByMe(Paging paging)
          Returns the 20 most recent retweets posted by the authenticating user.
 void getRetweetedToMe()
          Returns the 20 most recent retweets posted by the authenticating user's friends.
 void getRetweetedToMe(Paging paging)
          Returns the 20 most recent retweets posted by the authenticating user's friends.
 void getRetweets(long statusId)
          Returns up to 100 of the first retweets of a given tweet.
 void getRetweetsOfMe()
          Returns the 20 most recent tweets of the authenticated user that have been retweeted by others.
 void getRetweetsOfMe(Paging paging)
          Returns the 20 most recent tweets of the authenticated user that have been retweeted by others.
 void getSentDirectMessages()
          Returns a list of the direct messages sent by the authenticating user.
 void getSentDirectMessages(Paging paging)
          Returns a list of the direct messages sent by the authenticating user.
 void getTrends()
          Returns the top ten topics that are currently trending on Twitter.
 void getUserTimeline()
          Returns the most recent statuses posted in the last 24 hours from the authenticating user.
 void getUserTimeline(int userId)
          Returns the most recent statuses posted in the last 24 hours from the specified user id.
 void getUserTimeline(int userId, Paging paging)
          Returns the most recent statuses posted in the last 24 hours from the specified screenName.
 void getUserTimeline(Paging paging)
          Returns the most recent statuses posted in the last 24 hours from the specified user id.
 void getUserTimeline(java.lang.String screenName)
          Returns the most recent statuses posted in the last 24 hours from the specified user id.
 void getUserTimeline(java.lang.String screenName, Paging paging)
          Returns the most recent statuses posted in the last 24 hours from the specified screenName.
 void getWeeklyTrends()
          Returns the top 30 trending topics for each day in a given week.
 void getWeeklyTrends(java.util.Date date, boolean excludeHashTags)
          Returns the top 30 trending topics for each day in a given week.
 void reportSpam(int userId)
          The user specified in the id is blocked by the authenticated user and reported as a spammer.
 void reportSpam(java.lang.String screenName)
          The user specified in the id is blocked by the authenticated user and reported as a spammer.
 void retweetStatus(long statusId)
          Retweets a tweet.
 void search(Query query)
          Returns tweets that match a specified query.
 void searchUsers(java.lang.String query, int page)
          Run a search for users similar to Find People button on Twitter.com; the same results returned by people search on Twitter.com will be returned by using this API (about being listed in the People Search).
 void sendDirectMessage(int userId, java.lang.String text)
          Sends a new direct message to the specified user from the authenticating user.
 void sendDirectMessage(java.lang.String screenName, java.lang.String text)
          Sends a new direct message to the specified user from the authenticating user.
 void setOAuthAccessToken(AccessToken accessToken)
          Sets the access token
 void setOAuthAccessToken(java.lang.String token, java.lang.String tokenSecret)
          Sets the access token
 void setOAuthConsumer(java.lang.String consumerKey, java.lang.String consumerSecret)
          sets the OAuth consumer key and consumer secret
 void showFriendship(int sourceId, int targetId)
          Gets the detailed relationship status between a source user and a target user
This method calls http://api.twitter.com/1/friendships/show.json
 void showFriendship(java.lang.String sourceScreenName, java.lang.String targetScreenName)
          Gets the detailed relationship status between a source user and a target user
This method calls http://api.twitter.com/1/friendships/show.json
 void showStatus(long id)
          Returns a single status, specified by the id parameter.
 void showUser(int userId)
          Retrieves extended information of a given user, specified by screen name.
 void showUser(java.lang.String screenName)
          Retrieves extended information of a given user, specified by screen name.
 void shutdown()
          Shuts down internal dispather thread.
 void test()
          Returns the string "ok" in the requested format with a 200 OK HTTP status code.
 void updateDeliveryDevice(Device device)
          Sets which device Twitter delivers updates to for the authenticating user.
 void updateProfile(java.lang.String name, java.lang.String email, java.lang.String url, java.lang.String location, java.lang.String description)
          Sets values that users are able to set under the "Account" tab of their settings page.
 void updateProfileBackgroundImage(java.io.File image, boolean tile)
          Updates the authenticating user's profile background image.
 void updateProfileColors(java.lang.String profileBackgroundColor, java.lang.String profileTextColor, java.lang.String profileLinkColor, java.lang.String profileSidebarFillColor, java.lang.String profileSidebarBorderColor)
          Sets one or more hex values that control the color scheme of the authenticating user's profile page on twitter.com.
 void updateProfileImage(java.io.File image)
          Updates the authenticating user's profile image.
 void updateStatus(java.lang.String status)
          Updates the user's status asynchronously
This method calls http://api.twitter.com/1/statuses/update
 void updateStatus(java.lang.String status, GeoLocation location)
          Updates the user's status asynchronously.
 void updateStatus(java.lang.String status, long inReplyToStatusId)
          Updates the user's status asynchronously
This method calls http://api.twitter.com/1/statuses/update
 void updateStatus(java.lang.String status, long inReplyToStatusId, GeoLocation location)
          Updates the user's status.
 
Methods inherited from class twitter4j.TwitterOAuthSupportBase
equals, hashCode, httpResponseReceived, isOAuthEnabled, setRateLimitStatusListener
 
Methods inherited from class twitter4j.TwitterBase
ensureAuthorizationEnabled, ensureBasicEnabled, ensureBasicNotEnabled, getAuthorization, isBasicAuthEnabled, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

twitter

private Twitter twitter

listener

private TwitterListener listener

dispatcher

private static transient Dispatcher dispatcher

shutdown

private boolean shutdown
Constructor Detail

AsyncTwitter

public AsyncTwitter(java.lang.String screenName,
                    java.lang.String password,
                    TwitterListener listener)
Deprecated. use new AsyncTwitterFactory.getBasicAuthorizedInstance() instead.

Creates a basic authenticated AsyncTwitter instance.

Parameters:
screenName - screen name
password - password
listener -

AsyncTwitter

AsyncTwitter(Configuration conf,
             Authorization auth,
             TwitterListener listener)
Method Detail

search

public void search(Query query)
Returns tweets that match a specified query.
This method calls http://search.twitter.com/search

Specified by:
search in interface SearchMethodsAsync
Parameters:
query - - the search condition
See Also:
Twitter API / Search API Documentation, Twitter API / Search Operators

getTrends

public void getTrends()
Returns the top ten topics that are currently trending on Twitter. The response includes the time of the request, the name of each trend, and the url to the Twitter Search results page for that topic.
This method calls http://search.twitter.com/trends

Specified by:
getTrends in interface SearchMethodsAsync
See Also:
Twitter Search API Method: trends

getCurrentTrends

public void getCurrentTrends()
Returns the current top 10 trending topics on Twitter. The response includes the time of the request, the name of each trending topic, and query used on Twitter Search results page for that topic.
This method calls http://search.twitter.com/trends/current

Specified by:
getCurrentTrends in interface SearchMethodsAsync
See Also:
Twitter Search API Method: trends

getCurrentTrends

public void getCurrentTrends(boolean excludeHashTags)
Returns the current top 10 trending topics on Twitter. The response includes the time of the request, the name of each trending topic, and query used on Twitter Search results page for that topic.
This method calls http://search.twitter.com/trends/current

Specified by:
getCurrentTrends in interface SearchMethodsAsync
Parameters:
excludeHashTags - Setting this to true will remove all hashtags from the trends list.
See Also:
Twitter Search API Method: trends

getDailyTrends

public void getDailyTrends()
Returns the top 20 trending topics for each hour in a given day.
This method calls http://search.twitter.com/trends/daily

Specified by:
getDailyTrends in interface SearchMethodsAsync
See Also:
Twitter Search API Method: trends daily

getDailyTrends

public void getDailyTrends(java.util.Date date,
                           boolean excludeHashTags)
Returns the top 20 trending topics for each hour in a given day.
This method calls http://search.twitter.com/trends/daily

Specified by:
getDailyTrends in interface SearchMethodsAsync
Parameters:
date - Permits specifying a start date for the report.
excludeHashTags - Setting this to true will remove all hashtags from the trends list.
See Also:
Twitter Search API Method: trends daily

getWeeklyTrends

public void getWeeklyTrends()
Returns the top 30 trending topics for each day in a given week.
This method calls http://search.twitter.com/trends/weekly

Specified by:
getWeeklyTrends in interface SearchMethodsAsync
See Also:
Twitter Search API Method: trends weekly

getWeeklyTrends

public void getWeeklyTrends(java.util.Date date,
                            boolean excludeHashTags)
Returns the top 30 trending topics for each day in a given week.
This method calls http://search.twitter.com/trends/weekly

Specified by:
getWeeklyTrends in interface SearchMethodsAsync
Parameters:
date - Permits specifying a start date for the report.
excludeHashTags - Setting this to true will remove all hashtags from the trends list.
See Also:
Twitter Search API Method: trends weekly

getPublicTimeline

public void getPublicTimeline()
Returns the 20 most recent statuses from non-protected users who have set a custom user icon. The public timeline is cached for 60 seconds so requesting it more often than that is a waste of resources.
This method calls http://api.twitter.com/1/statuses/public_timeline

Specified by:
getPublicTimeline in interface TimelineMethodsAsync
See Also:
Twitter API Wiki / Twitter REST API Method: statuses public_timeline

getHomeTimeline

public void getHomeTimeline()
Returns the 20 most recent statuses, including retweets, posted by the authenticating user and that user's friends. This is the equivalent of /timeline/home on the Web.
This method calls http://api.twitter.com/1/statuses/home_timeline

Specified by:
getHomeTimeline in interface TimelineMethodsAsync
See Also:
Twitter API Wiki / Twitter REST API Method: statuses home_timeline

getHomeTimeline

public void getHomeTimeline(Paging paging)
Returns the 20 most recent statuses, including retweets, posted by the authenticating user and that user's friends. This is the equivalent of /timeline/home on the Web.
This method calls http://api.twitter.com/1/statuses/home_timeline

Specified by:
getHomeTimeline in interface TimelineMethodsAsync
Parameters:
paging - controls pagination
See Also:
Twitter API Wiki / Twitter REST API Method: statuses home_timeline

getFriendsTimeline

public void getFriendsTimeline()
Returns the 20 most recent statuses posted in the last 24 hours from the authenticating user and that user's friends. It's also possible to request another user's friends_timeline via the id parameter below.

Specified by:
getFriendsTimeline in interface TimelineMethodsAsync
See Also:
Twitter API Wiki / Twitter REST API Method: statuses friends_timeline

getFriendsTimeline

public void getFriendsTimeline(Paging paging)
Returns the 20 most recent statuses posted in the last 24 hours from the authenticating user and that user's friends. It's also possible to request another user's friends_timeline via the id parameter below.
This method calls http://api.twitter.com/1/statuses/friends_timeline

Specified by:
getFriendsTimeline in interface TimelineMethodsAsync
Parameters:
paging - controls pagination
See Also:
Twitter API Wiki / Twitter REST API Method: statuses friends_timeline

getUserTimeline

public void getUserTimeline(java.lang.String screenName,
                            Paging paging)
Returns the most recent statuses posted in the last 24 hours from the specified screenName.
This method calls http://api.twitter.com/1/statuses/user_timeline

Specified by:
getUserTimeline in interface TimelineMethodsAsync
Parameters:
screenName - Specifies the screen name of the user for whom to return the user_timeline.
paging - controls pagination
See Also:
Twitter API Wiki / Twitter REST API Method: statuses user_timeline

getUserTimeline

public void getUserTimeline(int userId,
                            Paging paging)
Returns the most recent statuses posted in the last 24 hours from the specified screenName.
This method calls http://api.twitter.com/1/statuses/user_timeline

Specified by:
getUserTimeline in interface TimelineMethodsAsync
Parameters:
userId - Specifies the ID of the user for whom to return the user_timeline.
paging - controls pagination
See Also:
Twitter API Wiki / Twitter REST API Method: statuses user_timeline

getUserTimeline

public void getUserTimeline(Paging paging)
Returns the most recent statuses posted in the last 24 hours from the specified user id.
This method calls http://api.twitter.com/1/statuses/user_timeline

Specified by:
getUserTimeline in interface TimelineMethodsAsync
Parameters:
paging - controls pagination
See Also:
Twitter API Wiki / Twitter REST API Method: statuses user_timeline

getUserTimeline

public void getUserTimeline(java.lang.String screenName)
Returns the most recent statuses posted in the last 24 hours from the specified user id.
This method calls http://api.twitter.com/1/statuses/user_timeline

Specified by:
getUserTimeline in interface TimelineMethodsAsync
Parameters:
screenName - Specifies the screen name of the user for whom to return the user_timeline.
See Also:
Twitter API Wiki / Twitter REST API Method: statuses user_timeline

getUserTimeline

public void getUserTimeline(int userId)
Returns the most recent statuses posted in the last 24 hours from the specified user id.
This method calls http://api.twitter.com/1/statuses/user_timeline

Specified by:
getUserTimeline in interface TimelineMethodsAsync
Parameters:
userId - Specifies the ID of the user for whom to return the user_timeline.
See Also:
Twitter API Wiki / Twitter REST API Method: statuses user_timeline

getUserTimeline

public void getUserTimeline()
Returns the most recent statuses posted in the last 24 hours from the authenticating user.
This method calls http://api.twitter.com/1/statuses/user_timeline

Specified by:
getUserTimeline in interface TimelineMethodsAsync
See Also:
Twitter API Wiki / Twitter REST API Method: statuses user_timeline

getMentions

public void getMentions()
Returns the 20 most recent replies (status updates prefixed with @username) to the authenticating user. Replies are only available to the authenticating user; you can not request a list of replies to another user whether public or protected.
This method calls http://api.twitter.com/1/statuses/mentions

Specified by:
getMentions in interface TimelineMethodsAsync
See Also:
Twitter API Wiki / Twitter REST API Method: statuses mentions

getMentions

public void getMentions(Paging paging)
Returns the 20 most recent replies (status updates prefixed with @username) to the authenticating user. Replies are only available to the authenticating user; you can not request a list of replies to another user whether public or protected.
This method calls http://api.twitter.com/1/statuses/mentions

Specified by:
getMentions in interface TimelineMethodsAsync
Parameters:
paging - controls pagination
See Also:
Twitter API Wiki / Twitter REST API Method: statuses mentions

getRetweetedByMe

public void getRetweetedByMe()
Returns the 20 most recent retweets posted by the authenticating user.
This method calls http://api.twitter.com/1/statuses/retweeted_by_me

Specified by:
getRetweetedByMe in interface TimelineMethodsAsync
See Also:
Twitter API Wiki / Twitter REST API Method: statuses/retweeted_by_me

getRetweetedByMe

public void getRetweetedByMe(Paging paging)
Returns the 20 most recent retweets posted by the authenticating user.
This method calls http://api.twitter.com/1/statuses/retweeted_by_me

Specified by:
getRetweetedByMe in interface TimelineMethodsAsync
Parameters:
paging - controls pagination
See Also:
Twitter API Wiki / Twitter REST API Method: statuses/retweeted_by_me

getRetweetedToMe

public void getRetweetedToMe()
Returns the 20 most recent retweets posted by the authenticating user's friends.
This method calls http://api.twitter.com/1/statuses/retweeted_to_me

Specified by:
getRetweetedToMe in interface TimelineMethodsAsync
See Also:
Twitter API Wiki / Twitter REST API Method: statuses/retweeted_to_me

getRetweetedToMe

public void getRetweetedToMe(Paging paging)
Returns the 20 most recent retweets posted by the authenticating user's friends.
This method calls http://api.twitter.com/1/statuses/retweeted_to_me

Specified by:
getRetweetedToMe in interface TimelineMethodsAsync
Parameters:
paging - controls pagination
See Also:
Twitter API Wiki / Twitter REST API Method: statuses/retweeted_to_me

getRetweetsOfMe

public void getRetweetsOfMe()
Returns the 20 most recent tweets of the authenticated user that have been retweeted by others.
This method calls http://api.twitter.com/1/statuses/retweets_of_me

Specified by:
getRetweetsOfMe in interface TimelineMethodsAsync
See Also:
Twitter API Wiki / Twitter REST API Method: statuses/retweets_of_me

getRetweetsOfMe

public void getRetweetsOfMe(Paging paging)
Returns the 20 most recent tweets of the authenticated user that have been retweeted by others.
This method calls http://api.twitter.com/1/statuses/retweets_of_me

Specified by:
getRetweetsOfMe in interface TimelineMethodsAsync
Parameters:
paging - controls pagination
See Also:
Twitter API Wiki / Twitter REST API Method: statuses/retweets_of_me

showStatus

public void showStatus(long id)
Returns a single status, specified by the id parameter. The status's author will be returned inline.
This method calls http://api.twitter.com/1/statuses/show

Specified by:
showStatus in interface StatusMethodsAsync
Parameters:
id - int
See Also:
Twitter API Wiki / Twitter REST API Method: statuses%C2%A0show

updateStatus

public void updateStatus(java.lang.String status)
Updates the user's status asynchronously
This method calls http://api.twitter.com/1/statuses/update

Specified by:
updateStatus in interface StatusMethodsAsync
Parameters:
status - String
See Also:
Twitter API Wiki / Twitter REST API Method: statuses%C2%A0update

updateStatus

public void updateStatus(java.lang.String status,
                         GeoLocation location)
Updates the user's status asynchronously.
Statuses over 140 characters will be forcibly truncated.
This method calls http://api.twitter.com/1/statuses/update

Specified by:
updateStatus in interface StatusMethodsAsync
Parameters:
status - the text of your status update
location - The location that this tweet refers to.
See Also:
Twitter API Wiki / Twitter REST API Method: statuses update

updateStatus

public void updateStatus(java.lang.String status,
                         long inReplyToStatusId)
Updates the user's status asynchronously
This method calls http://api.twitter.com/1/statuses/update

Specified by:
updateStatus in interface StatusMethodsAsync
Parameters:
status - String
inReplyToStatusId - The ID of an existing status that the status to be posted is in reply to. This implicitly sets the in_reply_to_user_id attribute of the resulting status to the user ID of the message being replied to. Invalid/missing status IDs will be ignored.
See Also:
Twitter API Wiki / Twitter REST API Method: statuses%C2%A0update

updateStatus

public void updateStatus(java.lang.String status,
                         long inReplyToStatusId,
                         GeoLocation location)
Updates the user's status.
Statuses over 140 characters will be forcibly truncated.
This method calls http://api.twitter.com/1/statuses/update

Specified by:
updateStatus in interface StatusMethodsAsync
Parameters:
status - the text of your status update
inReplyToStatusId - The ID of an existing status that the status to be posted is in reply to. This implicitly sets the in_reply_to_user_id attribute of the resulting status to the user ID of the message being replied to. Invalid/missing status IDs will be ignored.
location - The location that this tweet refers to.
See Also:
Twitter API Wiki / Twitter REST API Method: statuses update

destroyStatus

public void destroyStatus(long statusId)
Destroys the status specified by the required ID parameter. asynchronously
This method calls http://api.twitter.com/1/statuses/destroy

Specified by:
destroyStatus in interface StatusMethodsAsync
Parameters:
statusId - String
See Also:
Twitter API Wiki / Twitter REST API Method: statuses%C2%A0destroy

retweetStatus

public void retweetStatus(long statusId)
Retweets a tweet. Requires the id parameter of the tweet you are retweeting. Returns the original tweet with retweet details embedded.
This method calls http://api.twitter.com/1/statuses/retweet

Specified by:
retweetStatus in interface StatusMethodsAsync
Parameters:
statusId - The ID of the status to retweet.
See Also:
Twitter API Wiki / Twitter REST API Method: statuses retweet

getRetweets

public void getRetweets(long statusId)
Returns up to 100 of the first retweets of a given tweet.
This method calls http://api.twitter.com/1/statuses/retweets

Specified by:
getRetweets in interface StatusMethodsAsync
Parameters:
statusId - The numerical ID of the tweet you want the retweets of.
See Also:
Twitter API Wiki / Twitter REST API Method: statuses retweets

showUser

public void showUser(java.lang.String screenName)
Retrieves extended information of a given user, specified by screen name. This information includes design settings, so third party developers can theme their widgets according to a given user's preferences.
This method calls http://api.twitter.com/1/users/show

Specified by:
showUser in interface UserMethodsAsync
Parameters:
screenName - the screen name of the user for whom to request the detail
See Also:
Twitter API Wiki / Twitter REST API Method: users%C2%A0show

showUser

public void showUser(int userId)
Retrieves extended information of a given user, specified by screen name. This information includes design settings, so third party developers can theme their widgets according to a given user's preferences.
This method calls http://api.twitter.com/1/users/show

Specified by:
showUser in interface UserMethodsAsync
Parameters:
userId - the ID of the user for whom to request the detail
See Also:
Twitter API Wiki / Twitter REST API Method: users%C2%A0show

searchUsers

public void searchUsers(java.lang.String query,
                        int page)
Run a search for users similar to Find People button on Twitter.com; the same results returned by people search on Twitter.com will be returned by using this API (about being listed in the People Search). It is only possible to retrieve the first 1000 matches from this API.
This method calls http://api.twitter.com/1/users/search.json

Specified by:
searchUsers in interface UserMethodsAsync
Parameters:
query - The query to run against people search.
page - Specifies the page of results to retrieve. Number of statuses per page is fixed to 20.
See Also:
Twitter API Wiki / Twitter REST API Method: users search

getFriendsStatuses

public void getFriendsStatuses()
Returns the specified user's friends, each with current status inline.
This method calls http://api.twitter.com/1/statuses/friends

Specified by:
getFriendsStatuses in interface UserMethodsAsync
See Also:
Twitter API Wiki / Twitter REST API Method: statuses%C2%A0friends

getFriendsStatuses

public void getFriendsStatuses(long cursor)
Returns the specified user's friends, each with current status inline.
This method calls http://api.twitter.com/1/statuses/friends

Specified by:
getFriendsStatuses in interface UserMethodsAsync
Parameters:
cursor - Breaks the results into pages. A single page contains 100 users. This is recommended for users who are followed by many other users. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list.
See Also:
Twitter API Wiki / Twitter REST API Method: statuses%C2%A0friends

getFriendsStatuses

public void getFriendsStatuses(java.lang.String screenName)
Returns the specified user's friends, each with current status inline.
This method calls http://api.twitter.com/1/statuses/friends

Specified by:
getFriendsStatuses in interface UserMethodsAsync
Parameters:
screenName - the screen name of the user for whom to request a list of friends
See Also:
Twitter API Wiki / Twitter REST API Method: statuses%C2%A0friends

getFriendsStatuses

public void getFriendsStatuses(int userId)
Returns the specified user's friends, each with current status inline.
This method calls http://api.twitter.com/1/statuses/friends

Specified by:
getFriendsStatuses in interface UserMethodsAsync
Parameters:
userId - the ID of the user for whom to request a list of friends
See Also:
Twitter API Wiki / Twitter REST API Method: statuses%C2%A0friends

getFriendsStatuses

public void getFriendsStatuses(java.lang.String screenName,
                               long cursor)
Returns the specified user's friends, each with current status inline.
This method calls http://api.twitter.com/1/statuses/friends

Specified by:
getFriendsStatuses in interface UserMethodsAsync
Parameters:
screenName - the screen name of the user for whom to request a list of friends
cursor - Breaks the results into pages. A single page contains 100 users. This is recommended for users who are followed by many other users. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list.
See Also:
Twitter API Wiki / Twitter REST API Method: statuses%C2%A0friends

getFriendsStatuses

public void getFriendsStatuses(int userId,
                               long cursor)
Returns the specified user's friends, each with current status inline.
This method calls http://api.twitter.com/1/statuses/friends

Specified by:
getFriendsStatuses in interface UserMethodsAsync
Parameters:
userId - the screen name of the user for whom to request a list of friends
cursor - Breaks the results into pages. A single page contains 100 users. This is recommended for users who are followed by many other users. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list.
See Also:
Twitter API Wiki / Twitter REST API Method: statuses%C2%A0friends

getFollowersStatuses

public void getFollowersStatuses()
Returns the authenticating user's followers, each with current status inline. They are ordered by the order in which they joined Twitter (this is going to be changed).
This method calls http://api.twitter.com/1/statuses/followers

Specified by:
getFollowersStatuses in interface UserMethodsAsync
See Also:
Twitter API Wiki / Twitter REST API Method: statuses%C2%A0followers

getFollowersStatuses

public void getFollowersStatuses(long cursor)
Returns the authenticating user's followers, each with current status inline. They are ordered by the order in which they joined Twitter (this is going to be changed).
This method calls http://api.twitter.com/1/statuses/followers

Specified by:
getFollowersStatuses in interface UserMethodsAsync
Parameters:
cursor - Breaks the results into pages. A single page contains 100 users. This is recommended for users who are followed by many other users. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list.
See Also:
Twitter API Wiki / Twitter REST API Method: statuses%C2%A0followers

getFollowersStatuses

public void getFollowersStatuses(java.lang.String screenName)
Returns the specified user's followers, each with current status inline. They are ordered by the order in which they joined Twitter (this is going to be changed).
This method calls http://api.twitter.com/1/statuses/followers

Specified by:
getFollowersStatuses in interface UserMethodsAsync
Parameters:
screenName - The screen name of the user for whom to request a list of followers.
See Also:
Twitter API Wiki / Twitter REST API Method: statuses%C2%A0followers

getFollowersStatuses

public void getFollowersStatuses(int userId)
Returns the specified user's followers, each with current status inline. They are ordered by the order in which they joined Twitter (this is going to be changed).
This method calls http://api.twitter.com/1/statuses/followers

Specified by:
getFollowersStatuses in interface UserMethodsAsync
Parameters:
userId - The ID of the user for whom to request a list of followers.
See Also:
Twitter API Wiki / Twitter REST API Method: statuses%C2%A0followers

getFollowersStatuses

public void getFollowersStatuses(java.lang.String screenName,
                                 long cursor)
Returns the specified user's followers, each with current status inline. They are ordered by the order in which they joined Twitter (this is going to be changed).
This method calls http://api.twitter.com/1/statuses/followers

Specified by:
getFollowersStatuses in interface UserMethodsAsync
Parameters:
screenName - The screen name of the user for whom to request a list of followers.
cursor - Breaks the results into pages. A single page contains 100 users. This is recommended for users who are followed by many other users. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list.
See Also:
Twitter API Wiki / Twitter REST API Method: statuses%C2%A0followers

getFollowersStatuses

public void getFollowersStatuses(int userId,
                                 long cursor)
Returns the specified user's followers, each with current status inline. They are ordered by the order in which they joined Twitter (this is going to be changed).
This method calls http://api.twitter.com/1/statuses/followers

Specified by:
getFollowersStatuses in interface UserMethodsAsync
Parameters:
userId - The ID of the user for whom to request a list of followers.
cursor - Breaks the results into pages. A single page contains 100 users. This is recommended for users who are followed by many other users. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list.
See Also:
Twitter API Wiki / Twitter REST API Method: statuses%C2%A0followers

getDirectMessages

public void getDirectMessages()
Returns a list of the direct messages sent to the authenticating user.
This method calls http://api.twitter.com/1/direct_messages

Specified by:
getDirectMessages in interface DirectMessageMethodsAsync
See Also:
Twitter API Wiki / Twitter REST API Method: direct_messages

getDirectMessages

public void getDirectMessages(Paging paging)
Returns a list of the direct messages sent to the authenticating user.
This method calls http://api.twitter.com/1/direct_messages

Specified by:
getDirectMessages in interface DirectMessageMethodsAsync
Parameters:
paging - controls pagination
See Also:
Twitter API Wiki / Twitter REST API Method: direct_messages

getSentDirectMessages

public void getSentDirectMessages()
Returns a list of the direct messages sent by the authenticating user.
This method calls http://api.twitter.com/1/direct_messages/sent

Specified by:
getSentDirectMessages in interface DirectMessageMethodsAsync
See Also:
Twitter API Wiki / Twitter REST API Method: direct_messages%C2%A0sent

getSentDirectMessages

public void getSentDirectMessages(Paging paging)
Returns a list of the direct messages sent by the authenticating user.
This method calls http://api.twitter.com/1/direct_messages/sent

Specified by:
getSentDirectMessages in interface DirectMessageMethodsAsync
Parameters:
paging - controls pagination
See Also:
Twitter API Wiki / Twitter REST API Method: direct_messages%C2%A0sent

sendDirectMessage

public void sendDirectMessage(java.lang.String screenName,
                              java.lang.String text)
Sends a new direct message to the specified user from the authenticating user. Requires both the user and text parameters below. The text will be trimed if the length of the text is exceeding 140 characters.
This method calls http://api.twitter.com/1/direct_messages/new

Specified by:
sendDirectMessage in interface DirectMessageMethodsAsync
Parameters:
screenName - the screen name of the user to whom send the direct message
text - The text of your direct message.
See Also:
Twitter API Wiki / Twitter REST API Method: direct_messages%C2%A0new

sendDirectMessage

public void sendDirectMessage(int userId,
                              java.lang.String text)
Sends a new direct message to the specified user from the authenticating user. Requires both the user and text parameters below. The text will be trimed if the length of the text is exceeding 140 characters.
This method calls http://api.twitter.com/1/direct_messages/new

Specified by:
sendDirectMessage in interface DirectMessageMethodsAsync
Parameters:
userId - the screen name of the user to whom send the direct message
text - The text of your direct message.
See Also:
Twitter API Wiki / Twitter REST API Method: direct_messages%C2%A0new

destroyDirectMessage

public void destroyDirectMessage(int id)
Delete specified direct message
This method calls http://api.twitter.com/1/direct_messages/destroy

Specified by:
destroyDirectMessage in interface DirectMessageMethodsAsync
Parameters:
id - int
See Also:
Twitter API Wiki / Twitter REST API Method: direct_messages%C2%A0destroy

createFriendship

public void createFriendship(java.lang.String screenName)
Befriends the user specified in the ID parameter as the authenticating user. Returns the befriended user in the requested format when successful.
This method calls http://api.twitter.com/1/friendships/create

Specified by:
createFriendship in interface FriendshipMethodsAsync
Parameters:
screenName - the screen name of the user to be befriended
See Also:
Twitter API Wiki / Twitter REST API Method: friendships%C2%A0create

createFriendship

public void createFriendship(int userId)
Befriends the user specified in the ID parameter as the authenticating user. Returns the befriended user in the requested format when successful.
This method calls http://api.twitter.com/1/friendships/create

Specified by:
createFriendship in interface FriendshipMethodsAsync
Parameters:
userId - the ID of the user to be befriended
See Also:
Twitter API Wiki / Twitter REST API Method: friendships%C2%A0create

createFriendship

public void createFriendship(java.lang.String screenName,
                             boolean follow)
Befriends the user specified in the ID parameter as the authenticating user. Returns the befriended user in the requested format when successful.
This method calls http://api.twitter.com/1/friendships/create

Specified by:
createFriendship in interface FriendshipMethodsAsync
Parameters:
screenName - the screen name of the user to be befriended
follow - Enable notifications for the target user in addition to becoming friends.
See Also:
Twitter API Wiki / Twitter REST API Method: friendships%C2%A0create

createFriendship

public void createFriendship(int userId,
                             boolean follow)
Befriends the user specified in the ID parameter as the authenticating user. Returns the befriended user in the requested format when successful.
This method calls http://api.twitter.com/1/friendships/create

Specified by:
createFriendship in interface FriendshipMethodsAsync
Parameters:
userId - the ID of the user to be befriended
follow - Enable notifications for the target user in addition to becoming friends.
See Also:
Twitter API Wiki / Twitter REST API Method: friendships%C2%A0create

destroyFriendship

public void destroyFriendship(java.lang.String screenName)
Discontinues friendship with the specified in the ID parameter as the authenticating user. Returns the un-friended user in the requested format when successful.
This method calls http://api.twitter.com/1/friendships/destroy

Specified by:
destroyFriendship in interface FriendshipMethodsAsync
Parameters:
screenName - the screen name of the user to be befriended
See Also:
Twitter API Wiki / Twitter REST API Method: friendships%C2%A0destroy

destroyFriendship

public void destroyFriendship(int userId)
Discontinues friendship with the specified in the ID parameter as the authenticating user. Returns the un-friended user in the requested format when successful.
This method calls http://api.twitter.com/1/friendships/destroy

Specified by:
destroyFriendship in interface FriendshipMethodsAsync
Parameters:
userId - the screen name of the user to be befriended
See Also:
Twitter API Wiki / Twitter REST API Method: friendships%C2%A0destroy

existsFriendship

public void existsFriendship(java.lang.String userA,
                             java.lang.String userB)
Tests if a friendship exists between two users.
This method calls http://api.twitter.com/1/friendships/exists

Specified by:
existsFriendship in interface FriendshipMethodsAsync
Parameters:
userA - The ID or screen_name of the first user to test friendship for.
userB - The ID or screen_name of the second user to test friendship for.
See Also:
Twitter API Wiki / Twitter REST API Method: friendships exists

showFriendship

public void showFriendship(java.lang.String sourceScreenName,
                           java.lang.String targetScreenName)
Gets the detailed relationship status between a source user and a target user
This method calls http://api.twitter.com/1/friendships/show.json

Specified by:
showFriendship in interface FriendshipMethodsAsync
Parameters:
sourceScreenName - the screen name of the source user
targetScreenName - the screen name of the target user
See Also:
Twitter API Wiki / Twitter REST API Method: friendships show

showFriendship

public void showFriendship(int sourceId,
                           int targetId)
Gets the detailed relationship status between a source user and a target user
This method calls http://api.twitter.com/1/friendships/show.json

Specified by:
showFriendship in interface FriendshipMethodsAsync
Parameters:
sourceId - the screen ID of the source user
targetId - the screen ID of the target user
See Also:
Twitter API Wiki / Twitter REST API Method: friendships show

getFriendsIDs

public void getFriendsIDs()
Returns an array of numeric IDs for every user the authenticating user is following.
This method calls http://api.twitter.com/1/friends/ids%C2%A0%C2%A0

Specified by:
getFriendsIDs in interface SocialGraphMethodsAsync
See Also:
Twitter API Wiki / Twitter REST API Method: friends%C2%A0ids

getFriendsIDs

public void getFriendsIDs(long cursor)
Returns an array of numeric IDs for every user the authenticating user is following.
This method calls http://api.twitter.com/1/friends/ids%C2%A0%C2%A0

Specified by:
getFriendsIDs in interface SocialGraphMethodsAsync
Parameters:
cursor - Specifies the page number of the results beginning at 1. A single page contains 5000 ids. This is recommended for users with large ID lists. If not provided all ids are returned.
See Also:
Twitter API Wiki / Twitter REST API Method: friends%C2%A0ids

getFriendsIDs

public void getFriendsIDs(int userId)
Returns an array of numeric IDs for every user the specified user is following.
This method calls http://api.twitter.com/1/friends/ids%C2%A0%C2%A0

Specified by:
getFriendsIDs in interface SocialGraphMethodsAsync
Parameters:
userId - Specifies the ID of the user for whom to return the friends list.
See Also:
Twitter API Wiki / Twitter REST API Method: friends%C2%A0ids

getFriendsIDs

public void getFriendsIDs(int userId,
                          long cursor)
Returns an array of numeric IDs for every user the specified user is following.
This method calls http://api.twitter.com/1/friends/ids%C2%A0%C2%A0

Specified by:
getFriendsIDs in interface SocialGraphMethodsAsync
Parameters:
userId - Specifies the ID of the user for whom to return the friends list.
cursor - Specifies the page number of the results beginning at 1. A single page contains 5000 ids. This is recommended for users with large ID lists. If not provided all ids are returned.
See Also:
Twitter API Wiki / Twitter REST API Method: friends%C2%A0ids

getFriendsIDs

public void getFriendsIDs(java.lang.String screenName)
Returns an array of numeric IDs for every user the specified user is following.
This method calls http://api.twitter.com/1/friends/ids%C2%A0%C2%A0

Specified by:
getFriendsIDs in interface SocialGraphMethodsAsync
Parameters:
screenName - Specifies the screen name of the user for whom to return the friends list.
See Also:
Twitter API Wiki / Twitter REST API Method: friends%C2%A0ids

getFriendsIDs

public void getFriendsIDs(java.lang.String screenName,
                          long cursor)
Returns an array of numeric IDs for every user the specified user is following.
This method calls http://api.twitter.com/1/friends/ids%C2%A0%C2%A0

Specified by:
getFriendsIDs in interface SocialGraphMethodsAsync
Parameters:
screenName - Specifies the screen name of the user for whom to return the friends list.
cursor - Specifies the page number of the results beginning at 1. A single page contains 5000 ids. This is recommended for users with large ID lists. If not provided all ids are returned.
See Also:
Twitter API Wiki / Twitter REST API Method: friends%C2%A0ids

getFollowersIDs

public void getFollowersIDs()
Returns an array of numeric IDs for every user the specified user is followed by.
This method calls http://api.twitter.com/1/followers/ids

Specified by:
getFollowersIDs in interface SocialGraphMethodsAsync
See Also:
Twitter API Wiki / Twitter REST API Method: followers%C2%A0ids

getFollowersIDs

public void getFollowersIDs(long cursor)
Returns an array of numeric IDs for every user the specified user is followed by.
This method calls http://api.twitter.com/1/followers/ids

Specified by:
getFollowersIDs in interface SocialGraphMethodsAsync
Parameters:
cursor - Breaks the results into pages. A single page contains 100 users. This is recommended for users who are followed by many other users. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list.
See Also:
Twitter API Wiki / Twitter REST API Method: followers%C2%A0ids

getFollowersIDs

public void getFollowersIDs(int userId)
Returns an array of numeric IDs for every user the specified user is followed by.
This method calls http://api.twitter.com/1/followers/ids

Specified by:
getFollowersIDs in interface SocialGraphMethodsAsync
Parameters:
userId - Specifies the ID of the user for whom to return the followers list.
See Also:
Twitter API Wiki / Twitter REST API Method: followers%C2%A0ids

getFollowersIDs

public void getFollowersIDs(int userId,
                            long cursor)
Returns an array of numeric IDs for every user the specified user is followed by.
This method calls http://api.twitter.com/1/followers/ids

Specified by:
getFollowersIDs in interface SocialGraphMethodsAsync
Parameters:
userId - Specifies the ID of the user for whom to return the followers list.
cursor - Specifies the page number of the results beginning at 1. A single page contains 5000 ids. This is recommended for users with large ID lists. If not provided all ids are returned.
See Also:
Twitter API Wiki / Twitter REST API Method: followers%C2%A0ids

getFollowersIDs

public void getFollowersIDs(java.lang.String screenName)
Returns an array of numeric IDs for every user the specified user is followed by.
This method calls http://api.twitter.com/1/followers/ids

Specified by:
getFollowersIDs in interface SocialGraphMethodsAsync
Parameters:
screenName - Specifies the screen name of the user for whom to return the followers list.
See Also:
Twitter API Wiki / Twitter REST API Method: followers%C2%A0ids

getFollowersIDs

public void getFollowersIDs(java.lang.String screenName,
                            long cursor)
Returns an array of numeric IDs for every user the specified user is followed by.
This method calls http://api.twitter.com/1/followers/ids

Specified by:
getFollowersIDs in interface SocialGraphMethodsAsync
Parameters:
screenName - Specifies the screen name of the user for whom to return the followers list.
cursor - Specifies the page number of the results beginning at 1. A single page contains 5000 ids. This is recommended for users with large ID lists. If not provided all ids are returned.
See Also:
Twitter API Wiki / Twitter REST API Method: followers%C2%A0ids

updateProfile

public void updateProfile(java.lang.String name,
                          java.lang.String email,
                          java.lang.String url,
                          java.lang.String location,
                          java.lang.String description)
Sets values that users are able to set under the "Account" tab of their settings page. Only the parameters specified(non-null) will be updated.

Specified by:
updateProfile in interface AccountMethodsAsync
Parameters:
name - Optional. Maximum of 20 characters.
email - Optional. Maximum of 40 characters. Must be a valid email address.
url - Optional. Maximum of 100 characters. Will be prepended with "http://" if not present.
location - Optional. Maximum of 30 characters. The contents are not normalized or geocoded in any way.
description - Optional. Maximum of 160 characters.

getRateLimitStatus

public void getRateLimitStatus()
Gets the remaining number of API requests available to the requesting user before the API limit is reached for the current hour. Calls to rate_limit_status do not count against the rate limit. If authentication credentials are provided, the rate limit status for the authenticating user is returned. Otherwise, the rate limit status for the requester's IP address is returned.
This method calls http://api.twitter.com/1/account/rate_limit_status

Specified by:
getRateLimitStatus in interface AccountMethodsAsync
See Also:
Twitter API Wiki / Twitter REST API Method: account rate_limit_status

updateDeliveryDevice

public void updateDeliveryDevice(Device device)
Sets which device Twitter delivers updates to for the authenticating user. Sending none as the device parameter will disable IM or SMS updates.
This method calls http://api.twitter.com/1/account/update_delivery_device

Specified by:
updateDeliveryDevice in interface AccountMethodsAsync
Parameters:
device - new Delivery device. Must be one of: IM, SMS, NONE.
See Also:
Twitter API Wiki / Twitter REST API Method: account update_delivery_device

updateProfileColors

public void updateProfileColors(java.lang.String profileBackgroundColor,
                                java.lang.String profileTextColor,
                                java.lang.String profileLinkColor,
                                java.lang.String profileSidebarFillColor,
                                java.lang.String profileSidebarBorderColor)
Sets one or more hex values that control the color scheme of the authenticating user's profile page on twitter.com. These values are also returned in the getUserDetail() method.
This method calls http://api.twitter.com/1/account/update_profile_colors

Specified by:
updateProfileColors in interface AccountMethodsAsync
Parameters:
profileBackgroundColor - optional, can be null
profileTextColor - optional, can be null
profileLinkColor - optional, can be null
profileSidebarFillColor - optional, can be null
profileSidebarBorderColor - optional, can be null
See Also:
Twitter API Wiki / Twitter REST API Method: account update_profile_colors

updateProfileImage

public void updateProfileImage(java.io.File image)
Updates the authenticating user's profile image.
This method calls http://api.twitter.com/1/account/update_profile_image.json

Specified by:
updateProfileImage in interface AccountMethodsAsync
Parameters:
image - Must be a valid GIF, JPG, or PNG image of less than 700 kilobytes in size. Images with width larger than 500 pixels will be scaled down.
See Also:
Twitter API Wiki / Twitter REST API Method: account update_profile_image

updateProfileBackgroundImage

public void updateProfileBackgroundImage(java.io.File image,
                                         boolean tile)
Updates the authenticating user's profile background image.
This method calls http://api.twitter.com/1/account/update_profile_background_image.json

Specified by:
updateProfileBackgroundImage in interface AccountMethodsAsync
Parameters:
image - Must be a valid GIF, JPG, or PNG image of less than 800 kilobytes in size. Images with width larger than 2048 pixels will be forceably scaled down.
tile - If set to true the background image will be displayed tiled. The image will not be tiled otherwise.
See Also:
Twitter API Wiki / Twitter REST API Method: account update_profile_background_image

getFavorites

public void getFavorites()
Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.
This method calls http://api.twitter.com/1/favorites

Specified by:
getFavorites in interface FavoriteMethodsAsync
See Also:
Twitter API Wiki / Twitter REST API Method: favorites

getFavorites

public void getFavorites(int page)
Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.
This method calls http://api.twitter.com/1/favorites

Specified by:
getFavorites in interface FavoriteMethodsAsync
Parameters:
page - number of page to retrieve favorites
See Also:
Twitter API Wiki / Twitter REST API Method: favorites

getFavorites

public void getFavorites(java.lang.String id)
Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.
This method calls http://api.twitter.com/1/favorites

Specified by:
getFavorites in interface FavoriteMethodsAsync
Parameters:
id - the ID or screen name of the user for whom to request a list of favorite statuses
See Also:
Twitter API Wiki / Twitter REST API Method: favorites

getFavorites

public void getFavorites(java.lang.String id,
                         int page)
Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.
This method calls http://api.twitter.com/1/favorites

Specified by:
getFavorites in interface FavoriteMethodsAsync
Parameters:
id - the ID or screen name of the user for whom to request a list of favorite statuses.
page - retrieves the 20 next most recent favorite statuses.
See Also:
Twitter API Wiki / Twitter REST API Method: favorites

createFavorite

public void createFavorite(long id)
Favorites the status specified in the ID parameter as the authenticating user. Returns the favorite status when successful.
This method calls http://api.twitter.com/1/favorites/create%C2%A0

Specified by:
createFavorite in interface FavoriteMethodsAsync
Parameters:
id - the ID or screen name of the user for whom to request a list of favorite statuses.
See Also:
Twitter API Wiki / Twitter REST API Method: favorites%C2%A0create

destroyFavorite

public void destroyFavorite(long id)
Favorites the status specified in the ID parameter as the authenticating user. Returns the favorite status when successful.
This method calls http://api.twitter.com/1/favorites/destroy

Specified by:
destroyFavorite in interface FavoriteMethodsAsync
Parameters:
id - the ID or screen name of the user for whom to request a list of un-favorite statuses.
See Also:
Twitter API Wiki / Twitter REST API Method: favorites%C2%A0destroy

enableNotification

public void enableNotification(java.lang.String screenName)
Enables notifications for updates from the specified user to the authenticating user. Returns the specified user when successful.
This method calls http://api.twitter.com/1/notifications/follow

Specified by:
enableNotification in interface NotificationMethodsAsync
Parameters:
screenName - Specifies the screen name of the user to follow with device updates.
See Also:
Twitter API Wiki / Twitter REST API Method: notifications%C2%A0follow

enableNotification

public void enableNotification(int userId)
Enables notifications for updates from the specified user to the authenticating user. Returns the specified user when successful.
This method calls http://api.twitter.com/1/notifications/follow

Specified by:
enableNotification in interface NotificationMethodsAsync
Parameters:
userId - Specifies the ID of the user to follow with device updates.
See Also:
Twitter API Wiki / Twitter REST API Method: notifications%C2%A0follow

disableNotification

public void disableNotification(java.lang.String screenName)
Disables notifications for updates from the specified user to the authenticating user. Returns the specified user when successful.
This method calls http://api.twitter.com/1/notifications/leave

Specified by:
disableNotification in interface NotificationMethodsAsync
Parameters:
screenName - Specifies the screen name of the user to disable device notifications.
See Also:
Twitter API Wiki / Twitter REST API Method: notifications%C2%A0leave

disableNotification

public void disableNotification(int userId)
Disables notifications for updates from the specified user to the authenticating user. Returns the specified user when successful.
This method calls http://api.twitter.com/1/notifications/leave

Specified by:
disableNotification in interface NotificationMethodsAsync
Parameters:
userId - Specifies the ID of the user to disable device notifications.
See Also:
Twitter API Wiki / Twitter REST API Method: notifications%C2%A0leave

createBlock

public void createBlock(java.lang.String screenName)
Blocks the user specified in the ID parameter as the authenticating user. Returns the blocked user in the requested format when successful.
This method calls http://api.twitter.com/1/blocks/create%C2%A0

Specified by:
createBlock in interface BlockMethodsAsync
Parameters:
screenName - the screen_name of the user to block
See Also:
Twitter API Wiki / Twitter REST API Method: blocks%C2%A0create

createBlockAsync

public void createBlockAsync(int userId)
Blocks the user specified in the ID parameter as the authenticating user. Returns the blocked user in the requested format when successful.
This method calls http://api.twitter.com/1/blocks/create%C2%A0

Specified by:
createBlockAsync in interface BlockMethodsAsync
Parameters:
userId - the screen_name of the user to block
See Also:
Twitter API Wiki / Twitter REST API Method: blocks%C2%A0create

destroyBlock

public void destroyBlock(java.lang.String screenName)
Un-blocks the user specified in the ID parameter as the authenticating user. Returns the un-blocked user in the requested format when successful.
This method calls http://api.twitter.com/1/blocks/create%C2%A0

Specified by:
destroyBlock in interface BlockMethodsAsync
Parameters:
screenName - the screen_name of the user to block
See Also:
Twitter API Wiki / Twitter REST API Method: blocks%C2%A0destroy

destroyBlock

public void destroyBlock(int userId)
Un-blocks the user specified in the ID parameter as the authenticating user. Returns the un-blocked user in the requested format when successful.
This method calls http://api.twitter.com/1/blocks/create%C2%A0

Specified by:
destroyBlock in interface BlockMethodsAsync
Parameters:
userId - the ID of the user to block
See Also:
Twitter API Wiki / Twitter REST API Method: blocks%C2%A0destroy

existsBlock

public void existsBlock(java.lang.String screenName)
Tests if a friendship exists between two users.
This method calls http://api.twitter.com/1/blocks/exists/id.xml

Specified by:
existsBlock in interface BlockMethodsAsync
Parameters:
screenName - The screen_name of the potentially blocked user.
See Also:
Twitter API Wiki / Twitter REST API Method: blocks exists

existsBlock

public void existsBlock(int userId)
Tests if a friendship exists between two users.
This method calls http://api.twitter.com/1/blocks/exists/id.xml

Specified by:
existsBlock in interface BlockMethodsAsync
Parameters:
userId - The ID of the potentially blocked user.
See Also:
Twitter API Wiki / Twitter REST API Method: blocks exists

getBlockingUsers

public void getBlockingUsers()
Returns a list of user objects that the authenticating user is blocking.
This method calls http://api.twitter.com/1/blocks/blocking.xml

Specified by:
getBlockingUsers in interface BlockMethodsAsync
See Also:
Twitter API Wiki / Twitter REST API Method: blocks blocking

getBlockingUsers

public void getBlockingUsers(int page)
Returns a list of user objects that the authenticating user is blocking.
This method calls http://api.twitter.com/1/blocks/blocking.xml

Specified by:
getBlockingUsers in interface BlockMethodsAsync
Parameters:
page - the number of page
See Also:
Twitter API Wiki / Twitter REST API Method: blocks blocking

getBlockingUsersIDs

public void getBlockingUsersIDs()
Returns an array of numeric user ids the authenticating user is blocking.
This method calls http://api.twitter.com/1/blocks/blocking/ids

Specified by:
getBlockingUsersIDs in interface BlockMethodsAsync
See Also:
Twitter API Wiki / Twitter REST API Method: blocks blocking ids

reportSpam

public void reportSpam(int userId)
                throws TwitterException
The user specified in the id is blocked by the authenticated user and reported as a spammer.
This method calls http://api.twitter.com/1/report_spam.json

Specified by:
reportSpam in interface SpamReportingMethodsAsync
Parameters:
userId - The ID of the user you want to report as a spammer.
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: report_spam

reportSpam

public void reportSpam(java.lang.String screenName)
                throws TwitterException
The user specified in the id is blocked by the authenticated user and reported as a spammer.
This method calls http://api.twitter.com/1/report_spam.json

Specified by:
reportSpam in interface SpamReportingMethodsAsync
Parameters:
screenName - The screen name of the user you want to report as a spammer.
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: report_spam

test

public void test()
Returns the string "ok" in the requested format with a 200 OK HTTP status code.
This method calls http://api.twitter.com/1/help/test

Specified by:
test in interface HelpMethodsAsync
See Also:
Twitter API Wiki / Twitter REST API Method: help%C2%A0test

shutdown

public void shutdown()
Shuts down internal dispather thread.

Since:
Twitter4J 2.0.2

getDispatcher

private Dispatcher getDispatcher()

setOAuthConsumer

public void setOAuthConsumer(java.lang.String consumerKey,
                             java.lang.String consumerSecret)
Description copied from class: TwitterOAuthSupportBase
sets the OAuth consumer key and consumer secret

Specified by:
setOAuthConsumer in class TwitterOAuthSupportBase
Parameters:
consumerKey - OAuth consumer key
consumerSecret - OAuth consumer secret

getOAuthRequestToken

public RequestToken getOAuthRequestToken()
                                  throws TwitterException
Description copied from class: TwitterOAuthSupportBase
Retrieves a request token

Specified by:
getOAuthRequestToken in interface OAuthSupport
Specified by:
getOAuthRequestToken in class TwitterOAuthSupportBase
Returns:
generated request token.
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki - OAuth FAQ, OAuth Core 1.0a - 6.1. Obtaining an Unauthorized Request Token

getOAuthRequestToken

public RequestToken getOAuthRequestToken(java.lang.String callbackUrl)
                                  throws TwitterException
Description copied from class: TwitterOAuthSupportBase
Retrieves a request token

Specified by:
getOAuthRequestToken in interface OAuthSupport
Specified by:
getOAuthRequestToken in class TwitterOAuthSupportBase
Parameters:
callbackUrl - callback URL
Returns:
generated request token
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki - OAuth FAQ, OAuth Core 1.0a - 6.1. Obtaining an Unauthorized Request Token

getOAuthAccessToken

public AccessToken getOAuthAccessToken()
                                throws TwitterException
Description copied from class: TwitterOAuthSupportBase
Retrieves an access token.

Specified by:
getOAuthAccessToken in interface OAuthSupport
Specified by:
getOAuthAccessToken in class TwitterOAuthSupportBase
Returns:
access token
Throws:
TwitterException - when Twitter service or network is unavailable, or the user has not authorized
See Also:
Twitter API Wiki - How long does an access token last?, OAuth Core 1.0a - 6.2. Obtaining User Authorization

getOAuthAccessToken

public AccessToken getOAuthAccessToken(java.lang.String oauthVerifier)
                                throws TwitterException
Description copied from class: TwitterOAuthSupportBase
Retrieves an access token.

Specified by:
getOAuthAccessToken in interface OAuthSupport
Specified by:
getOAuthAccessToken in class TwitterOAuthSupportBase
Parameters:
oauthVerifier - OAuth verifier. AKA pin.
Returns:
access token
Throws:
TwitterException - when Twitter service or network is unavailable, or the user has not authorized
See Also:
Twitter API Wiki - How long does an access token last?, OAuth Core 1.0a - 6.2. Obtaining User Authorization

getOAuthAccessToken

public AccessToken getOAuthAccessToken(RequestToken requestToken)
                                throws TwitterException
Description copied from class: TwitterOAuthSupportBase
Retrieves an access token associated with the supplied request token and sets userId.

Specified by:
getOAuthAccessToken in interface OAuthSupport
Specified by:
getOAuthAccessToken in class TwitterOAuthSupportBase
Parameters:
requestToken - the request token
Returns:
access token associated with the supplied request token.
Throws:
TwitterException - when Twitter service or network is unavailable, or the user has not authorized
See Also:
Twitter API Wiki - How long does an access token last?, OAuth Core 1.0a - 6.2. Obtaining User Authorization

getOAuthAccessToken

public AccessToken getOAuthAccessToken(RequestToken requestToken,
                                       java.lang.String oauthVerifier)
                                throws TwitterException
Description copied from class: TwitterOAuthSupportBase
Retrieves an access token associated with the supplied request token and sets userId.

Specified by:
getOAuthAccessToken in interface OAuthSupport
Specified by:
getOAuthAccessToken in class TwitterOAuthSupportBase
Parameters:
requestToken - the request token
oauthVerifier - OAuth verifier. AKA pin.
Returns:
access token associated with the supplied request token.
Throws:
TwitterException - when Twitter service or network is unavailable, or the user has not authorized
See Also:
Twitter API Wiki - How long does an access token last?, OAuth Core 1.0a - 6.2. Obtaining User Authorization

setOAuthAccessToken

public void setOAuthAccessToken(AccessToken accessToken)
Description copied from class: TwitterOAuthSupportBase
Sets the access token

Specified by:
setOAuthAccessToken in interface OAuthSupport
Specified by:
setOAuthAccessToken in class TwitterOAuthSupportBase
Parameters:
accessToken - accessToken

getOAuthAccessToken

public AccessToken getOAuthAccessToken(java.lang.String token,
                                       java.lang.String tokenSecret)
                                throws TwitterException
Specified by:
getOAuthAccessToken in class TwitterOAuthSupportBase
Throws:
TwitterException

getOAuthAccessToken

public AccessToken getOAuthAccessToken(java.lang.String token,
                                       java.lang.String tokenSecret,
                                       java.lang.String pin)
                                throws TwitterException
Description copied from class: TwitterOAuthSupportBase
Retrieves an access token associated with the supplied request token.

Specified by:
getOAuthAccessToken in class TwitterOAuthSupportBase
Parameters:
token - request token
tokenSecret - request token secret
pin - pin
Returns:
access token associated with the supplied request token.
Throws:
TwitterException - when Twitter service or network is unavailable, or the user has not authorized
See Also:
Twitter API Wiki - How long does an access token last?, OAuth Core 1.0a - 6.2. Obtaining User Authorization

setOAuthAccessToken

public void setOAuthAccessToken(java.lang.String token,
                                java.lang.String tokenSecret)
Description copied from class: TwitterOAuthSupportBase
Sets the access token

Specified by:
setOAuthAccessToken in class TwitterOAuthSupportBase
Parameters:
token - access token
tokenSecret - access token secret