twitter4j
Class Twitter

java.lang.Object
  extended by twitter4j.TwitterSupport
      extended by twitter4j.Twitter
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AsyncTwitter

public class Twitter
extends TwitterSupport
implements java.io.Serializable

A java reporesentation of the Twitter API

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

Nested Class Summary
(package private) static class Twitter.Device
           
 
Field Summary
private  java.lang.String baseURL
           
private  java.text.SimpleDateFormat format
           
static Twitter.Device IM
           
static Twitter.Device NONE
           
private  java.lang.String searchBaseURL
           
private static long serialVersionUID
           
static Twitter.Device SMS
           
 
Fields inherited from class twitter4j.TwitterSupport
http, source, USE_SSL
 
Constructor Summary
Twitter()
           
Twitter(java.lang.String baseURL)
           
Twitter(java.lang.String id, java.lang.String password)
           
Twitter(java.lang.String id, java.lang.String password, java.lang.String baseURL)
           
 
Method Summary
private  void addParameterToList(java.util.List<twitter4j.http.PostParameter> colors, java.lang.String paramName, java.lang.String color)
           
 User block(java.lang.String id)
          Deprecated. Use createBlock(String id) instead
 User create(java.lang.String id)
          Deprecated. Use createFriendship(String id) instead
 User createBlock(java.lang.String id)
          Blocks the user specified in the ID parameter as the authenticating user.
 Status createFavorite(long id)
          Favorites the status specified in the ID parameter as the authenticating user.
 User createFriendship(java.lang.String id)
          Befriends the user specified in the ID parameter as the authenticating user.
 User createFriendship(java.lang.String id, boolean follow)
          Befriends the user specified in the ID parameter as the authenticating user.
 SavedSearch createSavedSearch(java.lang.String query)
          Retrieve the data for a saved search owned by the authenticating user specified by the given id.
 DirectMessage deleteDirectMessage(int id)
          Deprecated. Use destroyDirectMessage(int id) instead
 User destroy(java.lang.String id)
          Deprecated. Use destroyFriendship(String id) instead
 User destroyBlock(java.lang.String id)
          Un-blocks the user specified in the ID parameter as the authenticating user.
 DirectMessage destroyDirectMessage(int id)
          Destroys the direct message specified in the required ID parameter.
 Status destroyFavorite(long id)
          Un-favorites the status specified in the ID parameter as the authenticating user.
 User destroyFriendship(java.lang.String id)
          Discontinues friendship with the user specified in the ID parameter as the authenticating user.
 SavedSearch destroySavedSearch(int id)
          Destroys a saved search for the authenticated user.
 Status destroyStatus(long statusId)
          Destroys the status specified by the required ID parameter.
 User disableNotification(java.lang.String id)
          Disables notifications for updates from the specified user to the authenticating user.
 User enableNotification(java.lang.String id)
          Enables notifications for updates from the specified user to the authenticating user.
 boolean equals(java.lang.Object o)
           
 boolean exists(java.lang.String userA, java.lang.String userB)
          Deprecated. Use friendshipExists(String userA, String userB)
 boolean existsBlock(java.lang.String id)
          Tests if a friendship exists between two users.
 boolean existsFriendship(java.lang.String userA, java.lang.String userB)
          Tests if a friendship exists between two users.
 java.util.List<Status> favorites()
          Deprecated. Use getFavorited() instead
 java.util.List<Status> favorites(int page)
          Deprecated. Use getFavorites(int page) instead
 java.util.List<Status> favorites(java.lang.String id)
          Deprecated. Use getFavorites(String id) instead
 java.util.List<Status> favorites(java.lang.String id, int page)
          Deprecated. Use getFavorites(String id, int page) instead
 User follow(java.lang.String id)
          Deprecated. Use enableNotification(String id) instead
private  twitter4j.http.Response get(java.lang.String url, boolean authenticate)
          Issues an HTTP GET request.
protected  twitter4j.http.Response get(java.lang.String url, twitter4j.http.PostParameter[] params, boolean authenticate)
          Issues an HTTP GET request.
protected  twitter4j.http.Response get(java.lang.String url, twitter4j.http.PostParameter[] params, Paging paging, boolean authenticate)
          Issues an HTTP GET request.
protected  twitter4j.http.Response get(java.lang.String url, java.lang.String name1, java.lang.String value1, boolean authenticate)
          Issues an HTTP GET request.
protected  twitter4j.http.Response get(java.lang.String url, java.lang.String name1, java.lang.String value1, java.lang.String name2, java.lang.String value2, boolean authenticate)
          Issues an HTTP GET request.
 User getAuthenticatedUser()
          Deprecated. Use verifyCredentials() instead
 java.lang.String getBaseURL()
          Returns the base URL
 java.util.List<User> getBlockingUsers()
          Returns a list of user objects that the authenticating user is blocking.
 java.util.List<User> getBlockingUsers(int page)
          Returns a list of user objects that the authenticating user is blocking.
 IDs getBlockingUsersIDs()
          Returns an array of numeric user ids the authenticating user is blocking.
 Trends getCurrentTrends()
          Returns the current top 10 trending topics on Twitter.
 Trends getCurrentTrends(boolean excludeHashTags)
          Returns the current top 10 trending topics on Twitter.
 java.util.List<Trends> getDailyTrends()
          Returns the top 20 trending topics for each hour in a given day.
 java.util.List<Trends> getDailyTrends(java.util.Date date, boolean excludeHashTags)
          Returns the top 20 trending topics for each hour in a given day.
 java.util.List<DirectMessage> getDirectMessages()
          Returns a list of the direct messages sent to the authenticating user.
 java.util.List<DirectMessage> getDirectMessages(java.util.Date since)
          Deprecated. Use getDirectMessages(Paging paging) instead
 java.util.List<DirectMessage> getDirectMessages(int sinceId)
          Deprecated. Use getDirectMessages(Paging paging) instead
 java.util.List<DirectMessage> getDirectMessages(int page, int sinceId)
          Deprecated. Use getDirectMessages(Paging paging) instead
 java.util.List<DirectMessage> getDirectMessages(Paging paging)
          Returns a list of the direct messages sent to the authenticating user.
 java.util.List<DirectMessage> getDirectMessagesByPage(int page)
          Deprecated. Use getDirectMessages(Paging paging) instead
 java.lang.String getDowntimeSchedule()
          Deprecated. this method is not supported by the Twitter API anymore
 java.util.List<Status> getFavorites()
          Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.
 java.util.List<Status> 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.
 java.util.List<Status> 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.
 java.util.List<Status> 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.
 java.util.List<User> getFeatured()
          Returns a list of the users currently featured on the site with their current statuses inline.
 java.util.List<User> getFollowers()
          Deprecated. use getFollowersStatuses() instead
 java.util.List<User> getFollowers(int page)
          Deprecated. Use getFollowersStatuses(Paging paging) instead
 java.util.List<User> getFollowers(Paging paging)
          Deprecated. use getFollowersStatuses(paging)
 java.util.List<User> getFollowers(java.lang.String id)
          Deprecated. use getFollowersStatuses(id) instead
 java.util.List<User> getFollowers(java.lang.String id, int page)
          Deprecated. Use getFollowersStatuses(String id, Paging paging) instead
 java.util.List<User> getFollowers(java.lang.String id, Paging paging)
          Deprecated. use getFollowersStatuses(id) instead
 IDs getFollowersIDs()
          Returns an array of numeric IDs for every user the specified user is followed by.
 IDs getFollowersIDs(int userId)
          Returns an array of numeric IDs for every user the specified user is followed by.
 IDs getFollowersIDs(int userId, long cursor)
          Returns an array of numeric IDs for every user the specified user is followed by.
 IDs getFollowersIDs(int userId, Paging paging)
          Deprecated. use getFollowersIDs(int userId, long cursor) instead
 IDs getFollowersIDs(long cursor)
          Returns an array of numeric IDs for every user the specified user is followed by.
 IDs getFollowersIDs(Paging paging)
          Deprecated. use getFollowersIDs(long cursor) instead
 IDs getFollowersIDs(java.lang.String screenName)
          Returns an array of numeric IDs for every user the specified user is followed by.
 IDs getFollowersIDs(java.lang.String screenName, long cursor)
          Returns an array of numeric IDs for every user the specified user is followed by.
 IDs getFollowersIDs(java.lang.String screenName, Paging paging)
          Deprecated. use getFollowersIDs(String screenName, long cursor) instead
 java.util.List<User> getFollowersStatuses()
          Returns the authenticating user's followers, each with current status inline.
 java.util.List<User> getFollowersStatuses(Paging paging)
          Returns the authenticating user's followers, each with current status inline.
 java.util.List<User> getFollowersStatuses(java.lang.String id)
          Returns the authenticating user's followers, each with current status inline.
 java.util.List<User> getFollowersStatuses(java.lang.String id, Paging paging)
          Returns the authenticating user's followers, each with current status inline.
 java.util.List<User> getFriends()
          Deprecated. use getFriendsStatues() instead
 java.util.List<User> getFriends(int page)
          Deprecated. Use getFriendsStatuses(Paging paging) instead
 java.util.List<User> getFriends(Paging paging)
          Deprecated. Use getFriendsStatuses(Paging paging) instead
 java.util.List<User> getFriends(java.lang.String id)
          Deprecated. use getFriendsStatuses(id) instead
 java.util.List<User> getFriends(java.lang.String id, int page)
          Deprecated. Use getFriendsStatuses(String id, Paging paging) instead
 java.util.List<User> getFriends(java.lang.String id, Paging paging)
          Deprecated. use getFriendsStatuses(id,paging) instead
 IDs getFriendsIDs()
          Returns an array of numeric IDs for every user the authenticating user is following.
 IDs getFriendsIDs(int userId)
          Returns an array of numeric IDs for every user the specified user is following.
all IDs are attempted to be returned, but large sets of IDs will likely fail with timeout errors.
 IDs getFriendsIDs(int userId, long cursor)
          Returns an array of numeric IDs for every user the specified user is following.
 IDs getFriendsIDs(int userId, Paging paging)
          Deprecated. use getFriendsIDs(int userId, long cursor) instead
 IDs getFriendsIDs(long cursor)
          Returns an array of numeric IDs for every user the authenticating user is following.
 IDs getFriendsIDs(Paging paging)
          Deprecated. use getFriendsIDs(long cursor) instead
 IDs getFriendsIDs(java.lang.String screenName)
          Returns an array of numeric IDs for every user the specified user is following.
 IDs getFriendsIDs(java.lang.String screenName, long cursor)
          Returns an array of numeric IDs for every user the specified user is following.
 IDs getFriendsIDs(java.lang.String screenName, Paging paging)
          Deprecated. use getFriendsIDs(String screenName, long cursor) instead
 java.util.List<User> getFriendsStatuses()
          Returns the specified user's friends, each with current status inline.
 java.util.List<User> getFriendsStatuses(Paging paging)
          Returns the specified user's friends, each with current status inline.
 java.util.List<User> getFriendsStatuses(java.lang.String id)
          Returns the user's friends, each with current status inline.
 java.util.List<User> getFriendsStatuses(java.lang.String id, Paging paging)
          Returns the user's friends, each with current status inline.
 java.util.List<Status> getFriendsTimeline()
          Returns the 20 most recent statuses posted in the last 24 hours from the authenticating1 user and that user's friends.
 java.util.List<Status> getFriendsTimeline(java.util.Date since)
          Deprecated. Use getFriendsTimeline(Paging paging) instead
 java.util.List<Status> getFriendsTimeline(int page)
          Deprecated. Use getFriendsTimeline(Paging paging) instead
 java.util.List<Status> getFriendsTimeline(long sinceId)
          Deprecated. Use getFriendsTimeline(Paging paging) instead
 java.util.List<Status> getFriendsTimeline(long sinceId, int page)
          Deprecated. Use getFriendsTimeline(Paging paging) instead
 java.util.List<Status> getFriendsTimeline(long sinceId, java.lang.String id, int page)
          Deprecated. The Twitter API does not support this method anymore.
 java.util.List<Status> getFriendsTimeline(Paging paging)
          Returns the 20 most recent statuses posted in the last 24 hours from the specified userid.
 java.util.List<Status> getFriendsTimeline(java.lang.String id)
          Deprecated. The Twitter API does not support this method anymore.
 java.util.List<Status> getFriendsTimeline(java.lang.String id, java.util.Date since)
          Deprecated. The Twitter API does not support this method anymore.
 java.util.List<Status> getFriendsTimeline(java.lang.String id, int page)
          Deprecated. The Twitter API does not support this method anymore.
 java.util.List<Status> getFriendsTimeline(java.lang.String id, long sinceId)
          Deprecated. The Twitter API does not support this method anymore.
 java.util.List<Status> getFriendsTimeline(java.lang.String id, Paging paging)
          Deprecated. The Twitter API does not support this method anymore.
 java.util.List<Status> getFriendsTimelineByPage(int page)
          Deprecated. Use getFriendsTimeline(Paging paging) instead
 java.util.List<Status> getFriendsTimelineByPage(java.lang.String id, int page)
          Deprecated. The Twitter API does not support this method anymore.
 java.util.List<Status> getHomeTimeline()
          Returns the 20 most recent statuses, including retweets, posted by the authenticating user and that user's friends.
 java.util.List<Status> getHomeTimeline(Paging paging)
          Returns the 20 most recent statuses, including retweets, posted by the authenticating user and that user's friends.
 java.util.List<Status> getMentions()
          Returns the 20 most recent mentions (status containing @username) for the authenticating user.
 java.util.List<Status> getMentions(Paging paging)
          Returns the 20 most recent mentions (status containing @username) for the authenticating user.
 twitter4j.http.AccessToken getOAuthAccessToken(twitter4j.http.RequestToken requestToken)
          Retrieves an access token assosiated with the supplied request token.
 twitter4j.http.AccessToken getOAuthAccessToken(twitter4j.http.RequestToken requestToken, java.lang.String pin)
          Retrieves an access token assosiated with the supplied request token and sets userId.
 twitter4j.http.AccessToken getOAuthAccessToken(java.lang.String token, java.lang.String tokenSecret)
          Retrieves an access token assosiated with the supplied request token and sets userId.
 twitter4j.http.AccessToken getOAuthAccessToken(java.lang.String token, java.lang.String tokenSecret, java.lang.String oauth_verifier)
          Retrieves an access token assosiated with the supplied request token.
 twitter4j.http.RequestToken getOAuthRequestToken()
          Retrieves a request token
 twitter4j.http.RequestToken getOAuthRequestToken(java.lang.String callback_url)
           
 java.util.List<Status> getPublicTimeline()
          Returns the 20 most recent statuses from non-protected users who have set a custom user icon.
 java.util.List<Status> getPublicTimeline(int sinceID)
          Deprecated. use getPublicTimeline(long sinceID) instead
 java.util.List<Status> getPublicTimeline(long sinceID)
          Returns only public statuses with an ID greater than (that is, more recent than) the specified ID.
 java.util.List<Status> getReplies()
          Deprecated. Use getMentions() instead
 java.util.List<Status> getReplies(int page)
          Deprecated. Use getMentions(Paging paging) instead
 java.util.List<Status> getReplies(long sinceId)
          Deprecated. Use getMentions(Paging paging) instead
 java.util.List<Status> getReplies(long sinceId, int page)
          Deprecated. Use getMentions(Paging paging) instead
 java.util.List<Status> getRepliesByPage(int page)
          Deprecated. Use getMentions(Paging paging) instead
 java.util.List<Status> getRetweetedByMe()
          Returns the 20 most recent retweets posted by the authenticating user.
 java.util.List<Status> getRetweetedByMe(Paging paging)
          Returns the 20 most recent retweets posted by the authenticating user.
 java.util.List<Status> getRetweetedToMe()
          Returns the 20 most recent retweets posted by the authenticating user's friends.
 java.util.List<Status> getRetweetedToMe(Paging paging)
          Returns the 20 most recent retweets posted by the authenticating user's friends.
 java.util.List<RetweetDetails> getRetweets(long statusId)
          Returns up to 100 of the first retweets of a given tweet.
 java.util.List<Status> getRetweetsOfMe()
          Returns the 20 most recent tweets of the authenticated user that have been retweeted by others.
 java.util.List<Status> getRetweetsOfMe(Paging paging)
          Returns the 20 most recent tweets of the authenticated user that have been retweeted by others.
 java.util.List<SavedSearch> getSavedSearches()
          Returns the authenticated user's saved search queries.
 java.lang.String getSearchBaseURL()
          Returns the search base url
 java.util.List<DirectMessage> getSentDirectMessages()
          Returns a list of the direct messages sent by the authenticating user.
 java.util.List<DirectMessage> getSentDirectMessages(java.util.Date since)
          Deprecated. using long sinceId is suggested.
 java.util.List<DirectMessage> getSentDirectMessages(int sinceId)
          Deprecated. Use getSentDirectMessages(Paging paging) instead
 java.util.List<DirectMessage> getSentDirectMessages(int page, int sinceId)
          Deprecated. Use getSentDirectMessages(Paging paging) instead
 java.util.List<DirectMessage> getSentDirectMessages(Paging paging)
          Returns a list of the direct messages sent by the authenticating user.
 Trends getTrends()
          Returns the top ten topics that are currently trending on Twitter.
 User getUserDetail(java.lang.String id)
          Deprecated. use showUser(id) instead
 java.util.List<Status> getUserTimeline()
          Returns the most recent statuses posted in the last 24 hours from the authenticating user.
 java.util.List<Status> getUserTimeline(int count, java.util.Date since)
          Deprecated. using long sinceId is suggested.
 java.util.List<Status> getUserTimeline(int count, long sinceId)
          Deprecated. Use getUserTimeline(String id, Paging paging) instead
 java.util.List<Status> getUserTimeline(long sinceId)
          Deprecated. Use getUserTimeline(Paging paging) instead
 java.util.List<Status> getUserTimeline(Paging paging)
          Returns the most recent statuses posted in the last 24 hours from the authenticating user.
 java.util.List<Status> getUserTimeline(java.lang.String id)
          Returns the most recent statuses posted in the last 24 hours from the specified userid.
 java.util.List<Status> getUserTimeline(java.lang.String id, java.util.Date since)
          Deprecated. Use getUserTimeline(String id, Paging paging) instead
 java.util.List<Status> getUserTimeline(java.lang.String id, int count)
          Deprecated. Use getUserTimeline(String id, Paging paging) instead
 java.util.List<Status> getUserTimeline(java.lang.String id, int count, java.util.Date since)
          Deprecated. using long sinceId is suggested.
 java.util.List<Status> getUserTimeline(java.lang.String id, int count, long sinceId)
          Deprecated. Use getUserTimeline(String id, Paging paging) instead
 java.util.List<Status> getUserTimeline(java.lang.String id, long sinceId)
          Deprecated. Use getUserTimeline(String id, Paging paging) instead
 java.util.List<Status> getUserTimeline(java.lang.String id, Paging paging)
          Returns the most recent statuses posted in the last 24 hours from the specified userid.
 java.util.List<Trends> getWeeklyTrends()
          Returns the top 30 trending topics for each day in a given week.
 java.util.List<Trends> getWeeklyTrends(java.util.Date date, boolean excludeHashTags)
          Returns the top 30 trending topics for each day in a given week.
 int hashCode()
           
 User leave(java.lang.String id)
          Deprecated. Use disableNotification(String id) instead
 RateLimitStatus rateLimitStatus()
          Returns the remaining number of API requests available to the requesting user before the API limit is reached for the current hour.
 Status retweetStatus(long statusId)
          Retweets a tweet.
 QueryResult search(Query query)
          Returns tweets that match a specified query.
 DirectMessage sendDirectMessage(java.lang.String id, java.lang.String text)
          Sends a new direct message to the specified user from the authenticating user.
 void setBaseURL(java.lang.String baseURL)
          Sets the base URL
 void setOAuthAccessToken(twitter4j.http.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)
           
 void setSearchBaseURL(java.lang.String searchBaseURL)
          Sets the search base URL
 Status show(int id)
          Deprecated. Use showStatus(long id) instead.
 Status show(long id)
          Deprecated. Use showStatus(long id) instead.
 SavedSearch showSavedSearch(int id)
          Retrieve the data for a saved search owned by the authenticating user specified by the given id.
 Status showStatus(long id)
          Returns a single status, specified by the id parameter.
 User showUser(java.lang.String id)
          Returns extended information of a given user, specified by ID or screen name as per the required id parameter below.
 boolean test()
          Returns the string "ok" in the requested format with a 200 OK HTTP status code.
private  java.lang.String toDateStr(java.util.Date date)
           
 java.lang.String toString()
           
 User unblock(java.lang.String id)
          Deprecated. Use destroyBlock(String id) instead
 Status update(java.lang.String status)
          Deprecated. Use updateStatus(String status) instead
 Status update(java.lang.String status, long inReplyToStatusId)
          Deprecated. Use updateStatus(String status, long inReplyToStatusId) instead
 User updateDeliverlyDevice(Twitter.Device device)
          Sets which device Twitter delivers updates to for the authenticating user.
 User updateLocation(java.lang.String location)
          Deprecated. Use updateProfile(String name, String email, String url, String location, String description) instead
 User 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.
 User 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.
 Status updateStatus(java.lang.String status)
          Updates the user's status.
 Status updateStatus(java.lang.String status, double latitude, double longitude)
          Updates the user's status.
 Status updateStatus(java.lang.String status, long inReplyToStatusId)
          Updates the user's status.
 Status updateStatus(java.lang.String status, long inReplyToStatusId, double latitude, double longitude)
          Updates the user's status.
 User verifyCredentials()
          Returns an HTTP 200 OK response code and a representation of the requesting user if authentication was successful; returns a 401 status code and an error message if not.
 
Methods inherited from class twitter4j.TwitterSupport
forceUsePost, getClientURL, getClientVersion, getPassword, getSource, getUserAgent, getUserId, isUsePostForced, setClientURL, setClientVersion, setHttpConnectionTimeout, setHttpProxy, setHttpProxyAuth, setHttpReadTimeout, setPassword, setRequestHeader, setRetryCount, setRetryIntervalSecs, setSource, setUserAgent, setUserId
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

baseURL

private java.lang.String baseURL

searchBaseURL

private java.lang.String searchBaseURL

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

IM

public static final Twitter.Device IM

SMS

public static final Twitter.Device SMS

NONE

public static final Twitter.Device NONE

format

private java.text.SimpleDateFormat format
Constructor Detail

Twitter

public Twitter()

Twitter

public Twitter(java.lang.String baseURL)

Twitter

public Twitter(java.lang.String id,
               java.lang.String password)

Twitter

public Twitter(java.lang.String id,
               java.lang.String password,
               java.lang.String baseURL)
Method Detail

setBaseURL

public void setBaseURL(java.lang.String baseURL)
Sets the base URL

Parameters:
baseURL - String the base URL

getBaseURL

public java.lang.String getBaseURL()
Returns the base URL

Returns:
the base URL

setSearchBaseURL

public void setSearchBaseURL(java.lang.String searchBaseURL)
Sets the search base URL

Parameters:
searchBaseURL - the search base URL
Since:
Twitter4J 1.1.7

getSearchBaseURL

public java.lang.String getSearchBaseURL()
Returns the search base url

Returns:
search base url
Since:
Twitter4J 1.1.7

setOAuthConsumer

public void setOAuthConsumer(java.lang.String consumerKey,
                             java.lang.String consumerSecret)
Parameters:
consumerKey - OAuth consumer key
consumerSecret - OAuth consumer secret
Since:
Twitter 2.0.0

getOAuthRequestToken

public twitter4j.http.RequestToken getOAuthRequestToken()
                                                 throws TwitterException
Retrieves a request token

Returns:
generated request token.
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter 2.0.0
See Also:
Twitter API Wiki - OAuth FAQ, OAuth Core 1.0 - 6.1. Obtaining an Unauthorized Request Token

getOAuthRequestToken

public twitter4j.http.RequestToken getOAuthRequestToken(java.lang.String callback_url)
                                                 throws TwitterException
Throws:
TwitterException

getOAuthAccessToken

public twitter4j.http.AccessToken getOAuthAccessToken(twitter4j.http.RequestToken requestToken)
                                               throws TwitterException
Retrieves an access token assosiated with the supplied request token.

Parameters:
requestToken - the request token
Returns:
access token associsted with the supplied request token.
Throws:
TwitterException - when Twitter service or network is unavailable, or the user has not authorized
Since:
Twitter 2.0.0
See Also:
Twitter API Wiki - How long does an access token last?, OAuth Core 1.0 - 6.2. Obtaining User Authorization

getOAuthAccessToken

public twitter4j.http.AccessToken getOAuthAccessToken(twitter4j.http.RequestToken requestToken,
                                                      java.lang.String pin)
                                               throws TwitterException
Retrieves an access token assosiated with the supplied request token and sets userId.

Parameters:
requestToken - the request token
pin - pin
Returns:
access token associsted with the supplied request token.
Throws:
TwitterException - when Twitter service or network is unavailable, or the user has not authorized
Since:
Twitter 2.0.8
See Also:
Twitter API Wiki - How long does an access token last?, OAuth Core 1.0 - 6.2. Obtaining User Authorization

getOAuthAccessToken

public twitter4j.http.AccessToken getOAuthAccessToken(java.lang.String token,
                                                      java.lang.String tokenSecret)
                                               throws TwitterException
Retrieves an access token assosiated with the supplied request token and sets userId.

Parameters:
token - request token
tokenSecret - request token secret
Returns:
access token associsted with the supplied request token.
Throws:
TwitterException - when Twitter service or network is unavailable, or the user has not authorized
Since:
Twitter 2.0.1
See Also:
Twitter API Wiki - How long does an access token last?, OAuth Core 1.0 - 6.2. Obtaining User Authorization

getOAuthAccessToken

public twitter4j.http.AccessToken getOAuthAccessToken(java.lang.String token,
                                                      java.lang.String tokenSecret,
                                                      java.lang.String oauth_verifier)
                                               throws TwitterException
Retrieves an access token assosiated with the supplied request token.

Parameters:
token - request token
tokenSecret - request token secret
oauth_verifier - oauth_verifier or pin
Returns:
access token associsted with the supplied request token.
Throws:
TwitterException - when Twitter service or network is unavailable, or the user has not authorized
Since:
Twitter 2.0.8
See Also:
Twitter API Wiki - How long does an access token last?, OAuth Core 1.0 - 6.2. Obtaining User Authorization

setOAuthAccessToken

public void setOAuthAccessToken(twitter4j.http.AccessToken accessToken)
Sets the access token

Parameters:
accessToken - accessToken
Since:
Twitter 2.0.0

setOAuthAccessToken

public void setOAuthAccessToken(java.lang.String token,
                                java.lang.String tokenSecret)
Sets the access token

Parameters:
token - token
tokenSecret - token secret
Since:
Twitter 2.0.0

get

private twitter4j.http.Response get(java.lang.String url,
                                    boolean authenticate)
                             throws TwitterException
Issues an HTTP GET request.

Parameters:
url - the request url
authenticate - if true, the request will be sent with BASIC authentication header
Returns:
the response
Throws:
TwitterException - when Twitter service or network is unavailable

get

protected twitter4j.http.Response get(java.lang.String url,
                                      java.lang.String name1,
                                      java.lang.String value1,
                                      boolean authenticate)
                               throws TwitterException
Issues an HTTP GET request.

Parameters:
url - the request url
authenticate - if true, the request will be sent with BASIC authentication header
name1 - the name of the first parameter
value1 - the value of the first parameter
Returns:
the response
Throws:
TwitterException - when Twitter service or network is unavailable

get

protected twitter4j.http.Response get(java.lang.String url,
                                      java.lang.String name1,
                                      java.lang.String value1,
                                      java.lang.String name2,
                                      java.lang.String value2,
                                      boolean authenticate)
                               throws TwitterException
Issues an HTTP GET request.

Parameters:
url - the request url
name1 - the name of the first parameter
value1 - the value of the first parameter
name2 - the name of the second parameter
value2 - the value of the second parameter
authenticate - if true, the request will be sent with BASIC authentication header
Returns:
the response
Throws:
TwitterException - when Twitter service or network is unavailable

get

protected twitter4j.http.Response get(java.lang.String url,
                                      twitter4j.http.PostParameter[] params,
                                      boolean authenticate)
                               throws TwitterException
Issues an HTTP GET request.

Parameters:
url - the request url
params - the request parameters
authenticate - if true, the request will be sent with BASIC authentication header
Returns:
the response
Throws:
TwitterException - when Twitter service or network is unavailable

get

protected twitter4j.http.Response get(java.lang.String url,
                                      twitter4j.http.PostParameter[] params,
                                      Paging paging,
                                      boolean authenticate)
                               throws TwitterException
Issues an HTTP GET request.

Parameters:
url - the request url
params - the request parameters
paging - controls pagination
authenticate - if true, the request will be sent with BASIC authentication header
Returns:
the response
Throws:
TwitterException - when Twitter service or network is unavailable

search

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

Parameters:
query - - the search condition
Returns:
the result
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 1.1.7
See Also:
Twitter API Wiki / Twitter Search API Method: search

getTrends

public Trends getTrends()
                 throws TwitterException
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

Returns:
the result
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.2
See Also:
Twitter Search API Method: trends

getCurrentTrends

public Trends getCurrentTrends()
                        throws TwitterException
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

Returns:
the result
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.2
See Also:
Twitter Search API Method: trends

getCurrentTrends

public Trends getCurrentTrends(boolean excludeHashTags)
                        throws TwitterException
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

Parameters:
excludeHashTags - Setting this to true will remove all hashtags from the trends list.
Returns:
the result
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.2
See Also:
Twitter Search API Method: trends

getDailyTrends

public java.util.List<Trends> getDailyTrends()
                                      throws TwitterException
Returns the top 20 trending topics for each hour in a given day.
This method calls http://search.twitter.com/trends/daily

Returns:
the result
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.2
See Also:
Twitter Search API Method: trends daily

getDailyTrends

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

Parameters:
date - Permits specifying a start date for the report.
excludeHashTags - Setting this to true will remove all hashtags from the trends list.
Returns:
the result
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.2
See Also:
Twitter Search API Method: trends daily

toDateStr

private java.lang.String toDateStr(java.util.Date date)

getWeeklyTrends

public java.util.List<Trends> getWeeklyTrends()
                                       throws TwitterException
Returns the top 30 trending topics for each day in a given week.
This method calls http://search.twitter.com/trends/weekly

Returns:
the result
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.2
See Also:
Twitter Search API Method: trends weekly

getWeeklyTrends

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

Parameters:
date - Permits specifying a start date for the report.
excludeHashTags - Setting this to true will remove all hashtags from the trends list.
Returns:
the result
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.2
See Also:
Twitter Search API Method: trends weekly

getPublicTimeline

public java.util.List<Status> getPublicTimeline()
                                         throws TwitterException
Returns the 20 most recent statuses from non-protected users who have set a custom user icon.
This method calls http://twitter.com/statuses/public_timeline

Returns:
list of statuses of the Public Timeline
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: statuses public_timeline

getPublicTimeline

public java.util.List<Status> getPublicTimeline(int sinceID)
                                         throws TwitterException
Deprecated. use getPublicTimeline(long sinceID) instead

Returns only public statuses with an ID greater than (that is, more recent than) the specified ID.
This method calls http://twitter.com/statuses/public_timeline

Parameters:
sinceID - returns only public statuses with an ID greater than (that is, more recent than) the specified ID
Returns:
the 20 most recent statuses
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: statuses public_timeline

getPublicTimeline

public java.util.List<Status> getPublicTimeline(long sinceID)
                                         throws TwitterException
Returns only public statuses with an ID greater than (that is, more recent than) the specified ID.
This method calls http://twitter.com/statuses/public_timeline

Parameters:
sinceID - returns only public statuses with an ID greater than (that is, more recent than) the specified ID
Returns:
the 20 most recent statuses
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: statuses public_timeline

getHomeTimeline

public java.util.List<Status> getHomeTimeline()
                                       throws TwitterException
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://twitter.com/statuses/home_timeline

Returns:
list of the home Timeline
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.10
See Also:
Twitter API Wiki / Twitter REST API Method: statuses home_timeline

getHomeTimeline

public java.util.List<Status> getHomeTimeline(Paging paging)
                                       throws TwitterException
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://twitter.com/statuses/home_timeline

Parameters:
paging - controls pagination
Returns:
list of the home Timeline
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.10
See Also:
Twitter API Wiki / Twitter REST API Method: statuses home_timeline

getFriendsTimeline

public java.util.List<Status> getFriendsTimeline()
                                          throws TwitterException
Returns the 20 most recent statuses posted in the last 24 hours from the authenticating1 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://twitter.com/statuses/friends_timeline

Returns:
list of the Friends Timeline
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: statuses friends_timeline

getFriendsTimelineByPage

public java.util.List<Status> getFriendsTimelineByPage(int page)
                                                throws TwitterException
Deprecated. Use getFriendsTimeline(Paging paging) instead

Returns the 20 most recent statuses posted in the last 24 hours from the authenticating user.
This method calls http://twitter.com/statuses/friends_timeline

Parameters:
page - the number of page
Returns:
list of the Friends Timeline
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: statuses friends_timeline

getFriendsTimeline

public java.util.List<Status> getFriendsTimeline(int page)
                                          throws TwitterException
Deprecated. Use getFriendsTimeline(Paging paging) instead

Returns the 20 most recent statuses posted in the last 24 hours from the authenticating user.
This method calls http://twitter.com/statuses/friends_timeline

Parameters:
page - the number of page
Returns:
list of the Friends Timeline
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 1.1.8
See Also:
Twitter API Wiki / Twitter REST API Method: statuses friends_timeline

getFriendsTimeline

public java.util.List<Status> getFriendsTimeline(long sinceId,
                                                 int page)
                                          throws TwitterException
Deprecated. Use getFriendsTimeline(Paging paging) instead

Returns the 20 most recent statuses posted in the last 24 hours from the authenticating user.
This method calls http://twitter.com/statuses/friends_timeline

Parameters:
sinceId - Returns only statuses with an ID greater than (that is, more recent than) the specified ID
page - the number of page
Returns:
list of the Friends Timeline
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 1.1.8
See Also:
Twitter API Wiki / Twitter REST API Method: statuses friends_timeline

getFriendsTimeline

public java.util.List<Status> getFriendsTimeline(java.lang.String id)
                                          throws TwitterException
Deprecated. The Twitter API does not support this method anymore.

Returns the 20 most recent statuses posted in the last 24 hours from the specified userid.
This method calls http://twitter.com/statuses/friends_timeline

Parameters:
id - specifies the ID or screen name of the user for whom to return the friends_timeline
Returns:
list of the Friends Timeline
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: statuses friends_timeline

getFriendsTimelineByPage

public java.util.List<Status> getFriendsTimelineByPage(java.lang.String id,
                                                       int page)
                                                throws TwitterException
Deprecated. The Twitter API does not support this method anymore.

Returns the 20 most recent statuses posted in the last 24 hours from the specified userid.
This method calls http://twitter.com/statuses/friends_timeline

Parameters:
id - specifies the ID or screen name of the user for whom to return the friends_timeline
page - the number of page
Returns:
list of the Friends Timeline
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: statuses friends_timeline

getFriendsTimeline

public java.util.List<Status> getFriendsTimeline(java.lang.String id,
                                                 int page)
                                          throws TwitterException
Deprecated. The Twitter API does not support this method anymore.

Returns the 20 most recent statuses posted in the last 24 hours from the specified userid.
This method calls http://twitter.com/statuses/friends_timeline

Parameters:
id - specifies the ID or screen name of the user for whom to return the friends_timeline
page - the number of page
Returns:
list of the Friends Timeline
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 1.1.8
See Also:
Twitter API Wiki / Twitter REST API Method: statuses friends_timeline

getFriendsTimeline

public java.util.List<Status> getFriendsTimeline(long sinceId,
                                                 java.lang.String id,
                                                 int page)
                                          throws TwitterException
Deprecated. The Twitter API does not support this method anymore.

Returns the 20 most recent statuses posted in the last 24 hours from the specified userid.
This method calls http://twitter.com/statuses/friends_timeline

Parameters:
sinceId - Returns only statuses with an ID greater than (that is, more recent than) the specified ID
id - specifies the ID or screen name of the user for whom to return the friends_timeline
page - the number of page
Returns:
list of the Friends Timeline
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 1.1.8
See Also:
Twitter API Wiki / Twitter REST API Method: statuses friends_timeline

getFriendsTimeline

public java.util.List<Status> getFriendsTimeline(Paging paging)
                                          throws TwitterException
Returns the 20 most recent statuses posted in the last 24 hours from the specified userid.
This method calls http://twitter.com/statuses/friends_timeline

Parameters:
paging - controls pagination
Returns:
list of the Friends Timeline
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
Twitter API Wiki / Twitter REST API Method: statuses friends_timeline

getFriendsTimeline

public java.util.List<Status> getFriendsTimeline(java.lang.String id,
                                                 Paging paging)
                                          throws TwitterException
Deprecated. The Twitter API does not support this method anymore.

Returns the 20 most recent statuses posted in the last 24 hours from the specified userid.
This method calls http://twitter.com/statuses/friends_timeline

Parameters:
id - specifies the ID or screen name of the user for whom to return the friends_timeline
paging - controls pagination
Returns:
list of the Friends Timeline
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
Twitter API Wiki / Twitter REST API Method: statuses friends_timeline

getFriendsTimeline

public java.util.List<Status> getFriendsTimeline(java.util.Date since)
                                          throws TwitterException
Deprecated. Use getFriendsTimeline(Paging paging) instead

Returns the 20 most recent statuses posted in the last 24 hours from the authenticating user.
This method calls http://twitter.com/statuses/friends_timeline

Parameters:
since - narrows the returned results to just those statuses created after the specified HTTP-formatted date
Returns:
list of the Friends Timeline
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: statuses friends_timeline

getFriendsTimeline

public java.util.List<Status> getFriendsTimeline(long sinceId)
                                          throws TwitterException
Deprecated. Use getFriendsTimeline(Paging paging) instead

Returns the 20 most recent statuses posted in the last 24 hours from the authenticating user.
This method calls http://twitter.com/statuses/friends_timeline

Parameters:
sinceId - Returns only statuses with an ID greater than (that is, more recent than) the specified ID
Returns:
list of the Friends Timeline
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 1.1.8
See Also:
Twitter API Wiki / Twitter REST API Method: statuses friends_timeline

getFriendsTimeline

public java.util.List<Status> getFriendsTimeline(java.lang.String id,
                                                 java.util.Date since)
                                          throws TwitterException
Deprecated. The Twitter API does not support this method anymore.

Returns the most recent statuses posted in the last 24 hours from the specified userid.
This method calls http://twitter.com/statuses/friends_timeline

Parameters:
id - specifies the ID or screen name of the user for whom to return the friends_timeline
since - narrows the returned results to just those statuses created after the specified HTTP-formatted date
Returns:
list of the Friends Timeline
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: statuses friends_timeline

getFriendsTimeline

public java.util.List<Status> getFriendsTimeline(java.lang.String id,
                                                 long sinceId)
                                          throws TwitterException
Deprecated. The Twitter API does not support this method anymore.

Returns the most recent statuses posted in the last 24 hours from the specified userid.
This method calls http://twitter.com/statuses/friends_timeline

Parameters:
id - specifies the ID or screen name of the user for whom to return the friends_timeline
sinceId - Returns only statuses with an ID greater than (that is, more recent than) the specified ID
Returns:
list of the Friends Timeline
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 1.1.8
See Also:
Twitter API Wiki / Twitter REST API Method: statuses friends_timeline

getUserTimeline

public java.util.List<Status> getUserTimeline(java.lang.String id,
                                              int count,
                                              java.util.Date since)
                                       throws TwitterException
Deprecated. using long sinceId is suggested.

Returns the most recent statuses posted in the last 24 hours from the specified userid.
This method calls http://twitter.com/statuses/user_timeline

Parameters:
id - specifies the ID or screen name of the user for whom to return the user_timeline
count - specifies the number of statuses to retrieve. May not be greater than 200 for performance purposes
since - narrows the returned results to just those statuses created after the specified HTTP-formatted date
Returns:
list of the user Timeline
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: statuses friends_timeline

getUserTimeline

public java.util.List<Status> getUserTimeline(java.lang.String id,
                                              int count,
                                              long sinceId)
                                       throws TwitterException
Deprecated. Use getUserTimeline(String id, Paging paging) instead

Returns the most recent statuses posted in the last 24 hours from the specified userid.
This method calls http://twitter.com/statuses/user_timeline

Parameters:
id - specifies the ID or screen name of the user for whom to return the user_timeline
count - specifies the number of statuses to retrieve. May not be greater than 200 for performance purposes
sinceId - Returns only statuses with an ID greater than (that is, more recent than) the specified ID
Returns:
list of the user Timeline
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 1.1.8
See Also:
Twitter API Wiki / Twitter REST API Method: statuses friends_timeline

getUserTimeline

public java.util.List<Status> getUserTimeline(java.lang.String id,
                                              Paging paging)
                                       throws TwitterException
Returns the most recent statuses posted in the last 24 hours from the specified userid.
This method calls http://twitter.com/statuses/user_timeline

Parameters:
id - specifies the ID or screen name of the user for whom to return the user_timeline
paging - controls pagenation
Returns:
list of the user Timeline
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
Twitter API Wiki / Twitter REST API Method: statuses friends_timeline

getUserTimeline

public java.util.List<Status> getUserTimeline(java.lang.String id,
                                              java.util.Date since)
                                       throws TwitterException
Deprecated. Use getUserTimeline(String id, Paging paging) instead

Returns the most recent statuses posted in the last 24 hours from the specified userid.
This method calls http://twitter.com/statuses/user_timeline

Parameters:
id - specifies the ID or screen name of the user for whom to return the user_timeline
since - narrows the returned results to just those statuses created after the specified HTTP-formatted date
Returns:
the 20 most recent statuses posted in the last 24 hours from the user
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: statuses friends_timeline

getUserTimeline

public java.util.List<Status> getUserTimeline(java.lang.String id,
                                              int count)
                                       throws TwitterException
Deprecated. Use getUserTimeline(String id, Paging paging) instead

Returns the most recent statuses posted in the last 24 hours from the specified userid.
This method calls http://twitter.com/statuses/user_timeline

Parameters:
id - specifies the ID or screen name of the user for whom to return the user_timeline
count - specifies the number of statuses to retrieve. May not be greater than 200 for performance purposes
Returns:
the 20 most recent statuses posted in the last 24 hours from the user
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: statuses friends_timeline

getUserTimeline

public java.util.List<Status> getUserTimeline(int count,
                                              java.util.Date since)
                                       throws TwitterException
Deprecated. using long sinceId is suggested.

Returns the most recent statuses posted in the last 24 hours from the authenticating user.
This method calls http://twitter.com/statuses/user_timeline

Parameters:
count - specifies the number of statuses to retrieve. May not be greater than 200 for performance purposes
since - narrows the returned results to just those statuses created after the specified HTTP-formatted date
Returns:
the 20 most recent statuses posted in the last 24 hours from the user
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: statuses friends_timeline

getUserTimeline

public java.util.List<Status> getUserTimeline(int count,
                                              long sinceId)
                                       throws TwitterException
Deprecated. Use getUserTimeline(String id, Paging paging) instead

Returns the most recent statuses posted in the last 24 hours from the authenticating user.
This method calls http://twitter.com/statuses/user_timeline

Parameters:
count - specifies the number of statuses to retrieve. May not be greater than 200 for performance purposes
sinceId - returns only statuses with an ID greater than (that is, more recent than) the specified ID.
Returns:
the 20 most recent statuses posted in the last 24 hours from the user
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.0
See Also:
Twitter API Wiki / Twitter REST API Method: statuses friends_timeline

getUserTimeline

public java.util.List<Status> getUserTimeline(java.lang.String id)
                                       throws TwitterException
Returns the most recent statuses posted in the last 24 hours from the specified userid.
This method calls http://twitter.com/statuses/user_timeline

Parameters:
id - specifies the ID or screen name of the user for whom to return the user_timeline
Returns:
the 20 most recent statuses posted in the last 24 hours from the user
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: statuses friends_timeline

getUserTimeline

public java.util.List<Status> getUserTimeline(java.lang.String id,
                                              long sinceId)
                                       throws TwitterException
Deprecated. Use getUserTimeline(String id, Paging paging) instead

Returns the most recent statuses posted in the last 24 hours from the specified userid.
This method calls http://twitter.com/statuses/user_timeline

Parameters:
id - specifies the ID or screen name of the user for whom to return the user_timeline
sinceId - returns only statuses with an ID greater than (that is, more recent than) the specified ID.
Returns:
the 20 most recent statuses posted in the last 24 hours from the user
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.0
See Also:
Twitter API Wiki / Twitter REST API Method: statuses friends_timeline

getUserTimeline

public java.util.List<Status> getUserTimeline()
                                       throws TwitterException
Returns the most recent statuses posted in the last 24 hours from the authenticating user.
This method calls http://twitter.com/statuses/user_timeline

Returns:
the 20 most recent statuses posted in the last 24 hours from the user
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: statuses friends_timeline

getUserTimeline

public java.util.List<Status> getUserTimeline(Paging paging)
                                       throws TwitterException
Returns the most recent statuses posted in the last 24 hours from the authenticating user.
This method calls http://twitter.com/statuses/user_timeline

Parameters:
paging - controls pagination
Returns:
the 20 most recent statuses posted in the last 24 hours from the user
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
Twitter API Wiki / Twitter REST API Method: statuses friends_timeline

getUserTimeline

public java.util.List<Status> getUserTimeline(long sinceId)
                                       throws TwitterException
Deprecated. Use getUserTimeline(Paging paging) instead

Returns the most recent statuses posted in the last 24 hours from the authenticating user.
This method calls http://twitter.com/statuses/user_timeline

Parameters:
sinceId - returns only statuses with an ID greater than (that is, more recent than) the specified ID.
Returns:
the 20 most recent statuses posted in the last 24 hours from the user
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.0
See Also:
Twitter API Wiki / Twitter REST API Method: statuses friends_timeline

getReplies

public java.util.List<Status> getReplies()
                                  throws TwitterException
Deprecated. Use getMentions() instead

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://twitter.com/statuses/mentions

Returns:
the 20 most recent replies
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: statuses mentions

getReplies

public java.util.List<Status> getReplies(long sinceId)
                                  throws TwitterException
Deprecated. Use getMentions(Paging paging) instead

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://twitter.com/statuses/mentions

Parameters:
sinceId - Returns only statuses with an ID greater than (that is, more recent than) the specified ID
Returns:
the 20 most recent replies
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 1.1.8
See Also:
Twitter API Wiki / Twitter REST API Method: statuses mentions

getRepliesByPage

public java.util.List<Status> getRepliesByPage(int page)
                                        throws TwitterException
Deprecated. Use getMentions(Paging paging) instead

Returns the 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://twitter.com/statuses/mentions

Parameters:
page - the number of page
Returns:
the 20 most recent replies
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: statuses mentions

getReplies

public java.util.List<Status> getReplies(int page)
                                  throws TwitterException
Deprecated. Use getMentions(Paging paging) instead

Returns the 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://twitter.com/statuses/mentions

Parameters:
page - the number of page
Returns:
the 20 most recent replies
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 1.1.8
See Also:
Twitter API Wiki / Twitter REST API Method: statuses mentions

getReplies

public java.util.List<Status> getReplies(long sinceId,
                                         int page)
                                  throws TwitterException
Deprecated. Use getMentions(Paging paging) instead

Returns the 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://twitter.com/statuses/mentions

Parameters:
sinceId - Returns only statuses with an ID greater than (that is, more recent than) the specified ID
page - the number of page
Returns:
the 20 most recent replies
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 1.1.8
See Also:
Twitter API Wiki / Twitter REST API Method: statuses mentions

getMentions

public java.util.List<Status> getMentions()
                                   throws TwitterException
Returns the 20 most recent mentions (status containing @username) for the authenticating user.
This method calls http://twitter.com/statuses/mentions

Returns:
the 20 most recent replies
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
Twitter API Wiki / Twitter REST API Method: statuses mentions

getMentions

public java.util.List<Status> getMentions(Paging paging)
                                   throws TwitterException
Returns the 20 most recent mentions (status containing @username) for the authenticating user.
This method calls http://twitter.com/statuses/mentions

Parameters:
paging - controls pagination
Returns:
the 20 most recent replies
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
Twitter API Wiki / Twitter REST API Method: statuses mentions

getRetweetedByMe

public java.util.List<Status> getRetweetedByMe()
                                        throws TwitterException
Returns the 20 most recent retweets posted by the authenticating user.
This method calls http://twitter.com/statuses/retweeted_by_me

Returns:
the 20 most recent retweets posted by the authenticating user
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.10
See Also:
Twitter API Wiki / Twitter REST API Method: statuses/retweeted_by_me

getRetweetedByMe

public java.util.List<Status> getRetweetedByMe(Paging paging)
                                        throws TwitterException
Returns the 20 most recent retweets posted by the authenticating user.
This method calls http://twitter.com/statuses/retweeted_by_me

Parameters:
paging - controls pagination
Returns:
the 20 most recent retweets posted by the authenticating user
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.10
See Also:
Twitter API Wiki / Twitter REST API Method: statuses/retweeted_by_me

getRetweetedToMe

public java.util.List<Status> getRetweetedToMe()
                                        throws TwitterException
Returns the 20 most recent retweets posted by the authenticating user's friends.
This method calls http://twitter.com/statuses/retweeted_to_me

Returns:
the 20 most recent retweets posted by the authenticating user's friends.
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.10
See Also:
Twitter API Wiki / Twitter REST API Method: statuses/retweeted_to_me

getRetweetedToMe

public java.util.List<Status> getRetweetedToMe(Paging paging)
                                        throws TwitterException
Returns the 20 most recent retweets posted by the authenticating user's friends.
This method calls http://twitter.com/statuses/retweeted_to_me

Parameters:
paging - controls pagination
Returns:
the 20 most recent retweets posted by the authenticating user's friends.
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.10
See Also:
Twitter API Wiki / Twitter REST API Method: statuses/retweeted_to_me

getRetweetsOfMe

public java.util.List<Status> getRetweetsOfMe()
                                       throws TwitterException
Returns the 20 most recent tweets of the authenticated user that have been retweeted by others.
This method calls http://twitter.com/statuses/retweets_of_me

Returns:
the 20 most recent tweets of the authenticated user that have been retweeted by others.
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.10
See Also:
Twitter API Wiki / Twitter REST API Method: statuses/retweets_of_me

getRetweetsOfMe

public java.util.List<Status> getRetweetsOfMe(Paging paging)
                                       throws TwitterException
Returns the 20 most recent tweets of the authenticated user that have been retweeted by others.
This method calls http://twitter.com/statuses/retweets_of_me

Parameters:
paging - controls pagination
Returns:
the 20 most recent tweets of the authenticated user that have been retweeted by others.
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.10
See Also:
Twitter API Wiki / Twitter REST API Method: statuses/retweets_of_me

show

public Status show(int id)
            throws TwitterException
Deprecated. Use showStatus(long id) instead.

Returns a single status, specified by the id parameter. The status's author will be returned inline.
This method calls http://twitter.com/statuses/show

Parameters:
id - the numerical ID of the status you're trying to retrieve
Returns:
a single status
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: statuses show

show

public Status show(long id)
            throws TwitterException
Deprecated. Use showStatus(long id) instead.

Returns a single status, specified by the id parameter. The status's author will be returned inline.
This method calls http://twitter.com/statuses/show

Parameters:
id - the numerical ID of the status you're trying to retrieve
Returns:
a single status
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 1.1.1
See Also:
Twitter API Wiki / Twitter REST API Method: statuses show

showStatus

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

Parameters:
id - the numerical ID of the status you're trying to retrieve
Returns:
a single status
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
Twitter API Wiki / Twitter REST API Method: statuses show

update

public Status update(java.lang.String status)
              throws TwitterException
Deprecated. Use updateStatus(String status) instead

Updates the user's status. The text will be trimed if the length of the text is exceeding 160 characters.
This method calls http://twitter.com/statuses/update

Parameters:
status - the text of your status update
Returns:
the latest status
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: statuses update

updateStatus

public Status updateStatus(java.lang.String status)
                    throws TwitterException
Updates the user's status. The text will be trimed if the length of the text is exceeding 160 characters.
This method calls http://twitter.com/statuses/update

Parameters:
status - the text of your status update
Returns:
the latest status
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
Twitter API Wiki / Twitter REST API Method: statuses update

updateStatus

public Status updateStatus(java.lang.String status,
                           double latitude,
                           double longitude)
                    throws TwitterException
Updates the user's status. The text will be trimed if the length of the text is exceeding 160 characters.
This method calls http://twitter.com/statuses/update

Parameters:
status - the text of your status update
latitude - The location's latitude that this tweet refers to.
longitude - The location's longitude that this tweet refers to.
Returns:
the latest status
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.10
See Also:
Twitter API Wiki / Twitter REST API Method: statuses update

update

public Status update(java.lang.String status,
                     long inReplyToStatusId)
              throws TwitterException
Deprecated. Use updateStatus(String status, long inReplyToStatusId) instead

Updates the user's status. The text will be trimed if the length of the text is exceeding 160 characters.
This method calls http://twitter.com/statuses/update

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.
Returns:
the latest status
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: statuses update

updateStatus

public Status updateStatus(java.lang.String status,
                           long inReplyToStatusId)
                    throws TwitterException
Updates the user's status. The text will be trimed if the length of the text is exceeding 160 characters.
This method calls http://twitter.com/statuses/update

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.
Returns:
the latest status
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
Twitter API Wiki / Twitter REST API Method: statuses update

updateStatus

public Status updateStatus(java.lang.String status,
                           long inReplyToStatusId,
                           double latitude,
                           double longitude)
                    throws TwitterException
Updates the user's status. The text will be trimed if the length of the text is exceeding 160 characters.
This method calls http://twitter.com/statuses/update

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.
latitude - The location's latitude that this tweet refers to.
longitude - The location's longitude that this tweet refers to.
Returns:
the latest status
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.10
See Also:
Twitter API Wiki / Twitter REST API Method: statuses update

destroyStatus

public Status destroyStatus(long statusId)
                     throws TwitterException
Destroys the status specified by the required ID parameter. The authenticating user must be the author of the specified status.
This method calls http://twitter.com/statuses/destroy

Parameters:
statusId - The ID of the status to destroy.
Returns:
the deleted status
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
1.0.5
See Also:
Twitter API Wiki / Twitter REST API Method: statuses destroy

retweetStatus

public Status retweetStatus(long statusId)
                     throws TwitterException
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://twitter.com/statuses/retweet

Parameters:
statusId - The ID of the status to retweet.
Returns:
the retweeted status
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.10
See Also:
Twitter API Wiki / Twitter REST API Method: statuses retweet

getRetweets

public java.util.List<RetweetDetails> getRetweets(long statusId)
                                           throws TwitterException
Returns up to 100 of the first retweets of a given tweet.
This method calls http://twitter.com/statuses/retweets

Parameters:
statusId - The numerical ID of the tweet you want the retweets of.
Returns:
the retweets of a given tweet
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.10
See Also:
Twitter API Wiki / Twitter REST API Method: statuses retweets

getUserDetail

public User getUserDetail(java.lang.String id)
                   throws TwitterException
Deprecated. use showUser(id) instead

Returns extended information of a given user, specified by ID or screen name as per the required id parameter below. This information includes design settings, so third party developers can theme their widgets according to a given user's preferences.
This method calls http://twitter.com/users/show

Parameters:
id - the ID or screen name of the user for whom to request the detail
Returns:
User
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: users show

showUser

public User showUser(java.lang.String id)
              throws TwitterException
Returns extended information of a given user, specified by ID or screen name as per the required id parameter below. This information includes design settings, so third party developers can theme their widgets according to a given user's preferences.
This method calls http://twitter.com/users/show

Parameters:
id - the ID or screen name of the user for whom to request the detail
Returns:
User
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.9
See Also:
Twitter API Wiki / Twitter REST API Method: users show

getFriends

public java.util.List<User> getFriends()
                                throws TwitterException
Deprecated. use getFriendsStatues() instead

Returns the specified user's friends, each with current status inline.
This method calls http://twitter.com/statuses/friends

Returns:
the list of friends
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: statuses friends

getFriendsStatuses

public java.util.List<User> getFriendsStatuses()
                                        throws TwitterException
Returns the specified user's friends, each with current status inline.
This method calls http://twitter.com/statuses/friends

Returns:
the list of friends
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.9
See Also:
Twitter API Wiki / Twitter REST API Method: statuses friends

getFriends

public java.util.List<User> getFriends(Paging paging)
                                throws TwitterException
Deprecated. Use getFriendsStatuses(Paging paging) instead

Returns the specified user's friends, each with current status inline.
This method calls http://twitter.com/statuses/friends

Parameters:
paging - controls pagination
Returns:
the list of friends
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
Twitter API Wiki / Twitter REST API Method: statuses friends

getFriendsStatuses

public java.util.List<User> getFriendsStatuses(Paging paging)
                                        throws TwitterException
Returns the specified user's friends, each with current status inline.
This method calls http://twitter.com/statuses/friends

Parameters:
paging - controls pagination
Returns:
the list of friends
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.9
See Also:
Twitter API Wiki / Twitter REST API Method: statuses friends

getFriends

public java.util.List<User> getFriends(int page)
                                throws TwitterException
Deprecated. Use getFriendsStatuses(Paging paging) instead

Returns the specified user's friends, each with current status inline.
This method calls http://twitter.com/statuses/friends

Parameters:
page - number of page
Returns:
the list of friends
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: statuses friends

getFriends

public java.util.List<User> getFriends(java.lang.String id)
                                throws TwitterException
Deprecated. use getFriendsStatuses(id) instead

Returns the user's friends, each with current status inline.
This method calls http://twitter.com/statuses/friends

Parameters:
id - the ID or screen name of the user for whom to request a list of friends
Returns:
the list of friends
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: statuses friends

getFriendsStatuses

public java.util.List<User> getFriendsStatuses(java.lang.String id)
                                        throws TwitterException
Returns the user's friends, each with current status inline.
This method calls http://twitter.com/statuses/friends

Parameters:
id - the ID or screen name of the user for whom to request a list of friends
Returns:
the list of friends
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.9
See Also:
Twitter API Wiki / Twitter REST API Method: statuses friends

getFriends

public java.util.List<User> getFriends(java.lang.String id,
                                       Paging paging)
                                throws TwitterException
Deprecated. use getFriendsStatuses(id,paging) instead

Returns the user's friends, each with current status inline.
This method calls http://twitter.com/statuses/friends

Parameters:
id - the ID or screen name of the user for whom to request a list of friends
paging - controls pagination
Returns:
the list of friends
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
Twitter API Wiki / Twitter REST API Method: statuses friends

getFriendsStatuses

public java.util.List<User> getFriendsStatuses(java.lang.String id,
                                               Paging paging)
                                        throws TwitterException
Returns the user's friends, each with current status inline.
This method calls http://twitter.com/statuses/friends

Parameters:
id - the ID or screen name of the user for whom to request a list of friends
paging - controls pagination
Returns:
the list of friends
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.9
See Also:
Twitter API Wiki / Twitter REST API Method: statuses friends

getFriends

public java.util.List<User> getFriends(java.lang.String id,
                                       int page)
                                throws TwitterException
Deprecated. Use getFriendsStatuses(String id, Paging paging) instead

Returns the user's friends, each with current status inline.
This method calls http://twitter.com/statuses/friends

Parameters:
id - the ID or screen name of the user for whom to request a list of friends
page - the number of page
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: statuses friends

getFollowers

public java.util.List<User> getFollowers()
                                  throws TwitterException
Deprecated. use getFollowersStatuses() instead

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://twitter.com/statuses/followers

Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: statuses followers

getFollowersStatuses

public java.util.List<User> getFollowersStatuses()
                                          throws TwitterException
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://twitter.com/statuses/followers

Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.9
See Also:
Twitter API Wiki / Twitter REST API Method: statuses followers

getFollowers

public java.util.List<User> getFollowers(Paging paging)
                                  throws TwitterException
Deprecated. use getFollowersStatuses(paging)

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://twitter.com/statuses/followers

Parameters:
paging - controls pagination
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
Twitter API Wiki / Twitter REST API Method: statuses followers

getFollowersStatuses

public java.util.List<User> getFollowersStatuses(Paging paging)
                                          throws TwitterException
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://twitter.com/statuses/followers

Parameters:
paging - controls pagination
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.9
See Also:
Twitter API Wiki / Twitter REST API Method: statuses followers

getFollowers

public java.util.List<User> getFollowers(int page)
                                  throws TwitterException
Deprecated. Use getFollowersStatuses(Paging paging) instead

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://twitter.com/statuses/followers

Parameters:
page - Retrieves the next 100 followers.
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 1.1.0
See Also:
Twitter API Wiki / Twitter REST API Method: statuses followers

getFollowers

public java.util.List<User> getFollowers(java.lang.String id)
                                  throws TwitterException
Deprecated. use getFollowersStatuses(id) instead

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://twitter.com/statuses/followers

Parameters:
id - The ID or screen name of the user for whom to request a list of followers.
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 1.1.0
See Also:
Twitter API Wiki / Twitter REST API Method: statuses followers

getFollowersStatuses

public java.util.List<User> getFollowersStatuses(java.lang.String id)
                                          throws TwitterException
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://twitter.com/statuses/followers

Parameters:
id - The ID or screen name of the user for whom to request a list of followers.
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.9
See Also:
Twitter API Wiki / Twitter REST API Method: statuses followers

getFollowers

public java.util.List<User> getFollowers(java.lang.String id,
                                         Paging paging)
                                  throws TwitterException
Deprecated. use getFollowersStatuses(id) instead

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://twitter.com/statuses/followers

Parameters:
id - The ID or screen name of the user for whom to request a list of followers.
paging - controls pagination
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
Twitter API Wiki / Twitter REST API Method: statuses followers

getFollowersStatuses

public java.util.List<User> getFollowersStatuses(java.lang.String id,
                                                 Paging paging)
                                          throws TwitterException
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://twitter.com/statuses/followers

Parameters:
id - The ID or screen name of the user for whom to request a list of followers.
paging - controls pagination
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.9
See Also:
Twitter API Wiki / Twitter REST API Method: statuses followers

getFollowers

public java.util.List<User> getFollowers(java.lang.String id,
                                         int page)
                                  throws TwitterException
Deprecated. Use getFollowersStatuses(String id, Paging paging) instead

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://twitter.com/statuses/followers

Parameters:
id - The ID or screen name of the user for whom to request a list of followers.
page - Retrieves the next 100 followers.
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 1.1.0
See Also:
Twitter API Wiki / Twitter REST API Method: statuses followers

getFeatured

public java.util.List<User> getFeatured()
                                 throws TwitterException
Returns a list of the users currently featured on the site with their current statuses inline.

Returns:
List of User
Throws:
TwitterException - when Twitter service or network is unavailable

getDirectMessages

public java.util.List<DirectMessage> getDirectMessages()
                                                throws TwitterException
Returns a list of the direct messages sent to the authenticating user.
This method calls http://twitter.com/direct_messages

Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: direct_messages

getDirectMessages

public java.util.List<DirectMessage> getDirectMessages(Paging paging)
                                                throws TwitterException
Returns a list of the direct messages sent to the authenticating user.
This method calls http://twitter.com/direct_messages

Parameters:
paging - controls pagination
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: direct_messages

getDirectMessagesByPage

public java.util.List<DirectMessage> getDirectMessagesByPage(int page)
                                                      throws TwitterException
Deprecated. Use getDirectMessages(Paging paging) instead

Returns a list of the direct messages sent to the authenticating user.
This method calls http://twitter.com/direct_messages

Parameters:
page - the number of page
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: direct_messages

getDirectMessages

public java.util.List<DirectMessage> getDirectMessages(int page,
                                                       int sinceId)
                                                throws TwitterException
Deprecated. Use getDirectMessages(Paging paging) instead

Returns a list of the direct messages sent to the authenticating user.
This method calls http://twitter.com/direct_messages

Parameters:
page - the number of page
sinceId - Returns only direct messages with an ID greater than (that is, more recent than) the specified ID.
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.0
See Also:
Twitter API Wiki / Twitter REST API Method: direct_messages

getDirectMessages

public java.util.List<DirectMessage> getDirectMessages(int sinceId)
                                                throws TwitterException
Deprecated. Use getDirectMessages(Paging paging) instead

Returns a list of the direct messages sent to the authenticating user.
This method calls http://twitter.com/direct_messages

Parameters:
sinceId - Returns only direct messages with an ID greater than (that is, more recent than) the specified ID.
Returns:
list of direct messages
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: direct_messages

getDirectMessages

public java.util.List<DirectMessage> getDirectMessages(java.util.Date since)
                                                throws TwitterException
Deprecated. Use getDirectMessages(Paging paging) instead

Returns a list of the direct messages sent to the authenticating user.
This method calls http://twitter.com/direct_messages

Parameters:
since - narrows the resulting list of direct messages to just those sent after the specified HTTP-formatted date
Returns:
list of direct messages
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: direct_messages

getSentDirectMessages

public java.util.List<DirectMessage> getSentDirectMessages()
                                                    throws TwitterException
Returns a list of the direct messages sent by the authenticating user.
This method calls http://twitter.com/direct_messages/sent

Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: direct_messages sent

getSentDirectMessages

public java.util.List<DirectMessage> getSentDirectMessages(Paging paging)
                                                    throws TwitterException
Returns a list of the direct messages sent by the authenticating user.
This method calls http://twitter.com/direct_messages/sent

Parameters:
paging - controls pagination
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
Twitter API Wiki / Twitter REST API Method: direct_messages sent

getSentDirectMessages

public java.util.List<DirectMessage> getSentDirectMessages(java.util.Date since)
                                                    throws TwitterException
Deprecated. using long sinceId is suggested.

Returns a list of the direct messages sent by the authenticating user.
This method calls http://twitter.com/direct_messages/sent

Parameters:
since - narrows the resulting list of direct messages to just those sent after the specified HTTP-formatted date
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: direct_messages sent

getSentDirectMessages

public java.util.List<DirectMessage> getSentDirectMessages(int sinceId)
                                                    throws TwitterException
Deprecated. Use getSentDirectMessages(Paging paging) instead

Returns a list of the direct messages sent by the authenticating user.
This method calls http://twitter.com/direct_messages/sent

Parameters:
sinceId - returns only sent direct messages with an ID greater than (that is, more recent than) the specified ID
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: direct_messages sent

getSentDirectMessages

public java.util.List<DirectMessage> getSentDirectMessages(int page,
                                                           int sinceId)
                                                    throws TwitterException
Deprecated. Use getSentDirectMessages(Paging paging) instead

Returns a list of the direct messages sent by the authenticating user.
This method calls http://twitter.com/direct_messages/sent

Parameters:
sinceId - returns only sent direct messages with an ID greater than (that is, more recent than) the specified ID
page - Retrieves the 20 next most recent direct messages.
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.0
See Also:
Twitter API Wiki / Twitter REST API Method: direct_messages sent

sendDirectMessage

public DirectMessage sendDirectMessage(java.lang.String id,
                                       java.lang.String text)
                                throws TwitterException
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://twitter.com/direct_messages/new

Parameters:
id - the ID or screen name of the user to whom send the direct message
text - String
Returns:
DirectMessage
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: direct_messages new

deleteDirectMessage

public DirectMessage deleteDirectMessage(int id)
                                  throws TwitterException
Deprecated. Use destroyDirectMessage(int id) instead

Destroys the direct message specified in the required ID parameter. The authenticating user must be the recipient of the specified direct message.
This method calls http://twitter.com/direct_messages/destroy

Parameters:
id - the ID of the direct message to destroy
Returns:
the deleted direct message
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: direct_messages destroy

destroyDirectMessage

public DirectMessage destroyDirectMessage(int id)
                                   throws TwitterException
Destroys the direct message specified in the required ID parameter. The authenticating user must be the recipient of the specified direct message.
This method calls http://twitter.com/direct_messages/destroy

Parameters:
id - the ID of the direct message to destroy
Returns:
the deleted direct message
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
Twitter API Wiki / Twitter REST API Method: direct_messages destroy

create

public User create(java.lang.String id)
            throws TwitterException
Deprecated. Use createFriendship(String id) instead

Befriends the user specified in the ID parameter as the authenticating user. Returns the befriended user in the requested format when successful. Returns a string describing the failure condition when unsuccessful.

Parameters:
id - the ID or screen name of the user to be befriended
Returns:
the befriended user
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: friendships create

createFriendship

public User createFriendship(java.lang.String id)
                      throws TwitterException
Befriends the user specified in the ID parameter as the authenticating user. Returns the befriended user in the requested format when successful. Returns a string describing the failure condition when unsuccessful.

Parameters:
id - the ID or screen name of the user to be befriended
Returns:
the befriended user
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
Twitter API Wiki / Twitter REST API Method: friendships create

createFriendship

public User createFriendship(java.lang.String id,
                             boolean follow)
                      throws TwitterException
Befriends the user specified in the ID parameter as the authenticating user. Returns the befriended user in the requested format when successful. Returns a string describing the failure condition when unsuccessful.

Parameters:
id - the ID or screen name of the user to be befriended
follow - Enable notifications for the target user in addition to becoming friends.
Returns:
the befriended user
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.2
See Also:
Twitter API Wiki / Twitter REST API Method: friendships create

destroy

public User destroy(java.lang.String id)
             throws TwitterException
Deprecated. Use destroyFriendship(String id) instead

Discontinues friendship with the user specified in the ID parameter as the authenticating user. Returns the un-friended user in the requested format when successful. Returns a string describing the failure condition when unsuccessful.

Parameters:
id - the ID or screen name of the user for whom to request a list of friends
Returns:
User
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: friendships destroy

destroyFriendship

public User destroyFriendship(java.lang.String id)
                       throws TwitterException
Discontinues friendship with the user specified in the ID parameter as the authenticating user. Returns the un-friended user in the requested format when successful. Returns a string describing the failure condition when unsuccessful.

Parameters:
id - the ID or screen name of the user for whom to request a list of friends
Returns:
User
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
Twitter API Wiki / Twitter REST API Method: friendships destroy

exists

public boolean exists(java.lang.String userA,
                      java.lang.String userB)
               throws TwitterException
Deprecated. Use friendshipExists(String userA, String userB)

Tests if a friendship exists between two users.

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.
Returns:
if a friendship exists between two users.
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: friendships exists

existsFriendship

public boolean existsFriendship(java.lang.String userA,
                                java.lang.String userB)
                         throws TwitterException
Tests if a friendship exists between two users.

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.
Returns:
if a friendship exists between two users.
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
Twitter API Wiki / Twitter REST API Method: friendships exists

getFriendsIDs

public IDs getFriendsIDs()
                  throws TwitterException
Returns an array of numeric IDs for every user the authenticating user is following.

Returns:
an array of numeric IDs for every user the authenticating user is following
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.0
See Also:
Twitter API Wiki / Twitter REST API Method: friends ids

getFriendsIDs

public IDs getFriendsIDs(Paging paging)
                  throws TwitterException
Deprecated. use getFriendsIDs(long cursor) instead

Returns an array of numeric IDs for every user the authenticating user is following.

Parameters:
paging - 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.
Returns:
an array of numeric IDs for every user the authenticating user is following
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
Twitter API Wiki / Twitter REST API Method: friends ids

getFriendsIDs

public IDs getFriendsIDs(long cursor)
                  throws TwitterException
Returns an array of numeric IDs for every user the authenticating user is following.

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.
Returns:
an array of numeric IDs for every user the authenticating user is following
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.10
See Also:
Twitter API Wiki / Twitter REST API Method: friends ids

getFriendsIDs

public IDs getFriendsIDs(int userId)
                  throws TwitterException
Returns an array of numeric IDs for every user the specified user is following.
all IDs are attempted to be returned, but large sets of IDs will likely fail with timeout errors.

Parameters:
userId - Specfies the ID of the user for whom to return the friends list.
Returns:
an array of numeric IDs for every user the specified user is following
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.0
See Also:
Twitter API Wiki / Twitter REST API Method: friends ids

getFriendsIDs

public IDs getFriendsIDs(int userId,
                         Paging paging)
                  throws TwitterException
Deprecated. use getFriendsIDs(int userId, long cursor) instead

Returns an array of numeric IDs for every user the specified user is following.

Parameters:
userId - Specifies the ID of the user for whom to return the friends list.
paging - 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.
Returns:
an array of numeric IDs for every user the specified user is following
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
Twitter API Wiki / Twitter REST API Method: friends ids

getFriendsIDs

public IDs getFriendsIDs(int userId,
                         long cursor)
                  throws TwitterException
Returns an array of numeric IDs for every user the specified user is following.

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.
Returns:
an array of numeric IDs for every user the specified user is following
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.10
See Also:
Twitter API Wiki / Twitter REST API Method: friends ids

getFriendsIDs

public IDs getFriendsIDs(java.lang.String screenName)
                  throws TwitterException
Returns an array of numeric IDs for every user the specified user is following.

Parameters:
screenName - Specfies the screen name of the user for whom to return the friends list.
Returns:
an array of numeric IDs for every user the specified user is following
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.0
See Also:
Twitter API Wiki / REST API Documentation - Social Graph Methods - friends/ids

getFriendsIDs

public IDs getFriendsIDs(java.lang.String screenName,
                         Paging paging)
                  throws TwitterException
Deprecated. use getFriendsIDs(String screenName, long cursor) instead

Returns an array of numeric IDs for every user the specified user is following.

Parameters:
screenName - Specfies the screen name of the user for whom to return the friends list.
paging - 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.
Returns:
an array of numeric IDs for every user the specified user is following
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
Twitter API Wiki / REST API Documentation - Social Graph Methods - friends/ids

getFriendsIDs

public IDs getFriendsIDs(java.lang.String screenName,
                         long cursor)
                  throws TwitterException
Returns an array of numeric IDs for every user the specified user is following.

Parameters:
screenName - Specfies 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.
Returns:
an array of numeric IDs for every user the specified user is following
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.10
See Also:
Twitter API Wiki / REST API Documentation - Social Graph Methods - friends/ids

getFollowersIDs

public IDs getFollowersIDs()
                    throws TwitterException
Returns an array of numeric IDs for every user the specified user is followed by.

Returns:
The ID or screen_name of the user to retrieve the friends ID list for.
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.0
See Also:
Twitter API Wiki / Twitter REST API Method: followers ids

getFollowersIDs

public IDs getFollowersIDs(Paging paging)
                    throws TwitterException
Deprecated. use getFollowersIDs(long cursor) instead

Returns an array of numeric IDs for every user the specified user is followed by.

Parameters:
paging - 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.
Returns:
The ID or screen_name of the user to retrieve the friends ID list for.
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
Twitter API Wiki / Twitter REST API Method: followers ids

getFollowersIDs

public IDs getFollowersIDs(long cursor)
                    throws TwitterException
Returns an array of numeric IDs for every user the specified user is followed by.

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.
Returns:
The ID or screen_name of the user to retrieve the friends ID list for.
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.10
See Also:
Twitter API Wiki / Twitter REST API Method: followers ids

getFollowersIDs

public IDs getFollowersIDs(int userId)
                    throws TwitterException
Returns an array of numeric IDs for every user the specified user is followed by.

Parameters:
userId - Specfies the ID of the user for whom to return the followers list.
Returns:
The ID or screen_name of the user to retrieve the friends ID list for.
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.0
See Also:
Twitter API Wiki / Twitter REST API Method: followers ids

getFollowersIDs

public IDs getFollowersIDs(int userId,
                           Paging paging)
                    throws TwitterException
Deprecated. use getFollowersIDs(int userId, long cursor) instead

Returns an array of numeric IDs for every user the specified user is followed by.

Parameters:
userId - Specfies the ID of the user for whom to return the followers list.
paging - 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.
Returns:
The ID or screen_name of the user to retrieve the friends ID list for.
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
Twitter API Wiki / Twitter REST API Method: followers ids

getFollowersIDs

public IDs getFollowersIDs(int userId,
                           long cursor)
                    throws TwitterException
Returns an array of numeric IDs for every user the specified user is followed by.

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.
Returns:
The ID or screen_name of the user to retrieve the friends ID list for.
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.10
See Also:
Twitter API Wiki / Twitter REST API Method: followers ids

getFollowersIDs

public IDs getFollowersIDs(java.lang.String screenName)
                    throws TwitterException
Returns an array of numeric IDs for every user the specified user is followed by.

Parameters:
screenName - Specfies the screen name of the user for whom to return the followers list.
Returns:
The ID or screen_name of the user to retrieve the friends ID list for.
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.0
See Also:
Twitter API Wiki / Twitter REST API Method: followers ids

getFollowersIDs

public IDs getFollowersIDs(java.lang.String screenName,
                           Paging paging)
                    throws TwitterException
Deprecated. use getFollowersIDs(String screenName, long cursor) instead

Returns an array of numeric IDs for every user the specified user is followed by.

Parameters:
screenName - Specfies the screen name of the user for whom to return the followers list.
paging - 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.
Returns:
The ID or screen_name of the user to retrieve the friends ID list for.
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
Twitter API Wiki / Twitter REST API Method: followers ids

getFollowersIDs

public IDs getFollowersIDs(java.lang.String screenName,
                           long cursor)
                    throws TwitterException
Returns an array of numeric IDs for every user the specified user is followed by.

Parameters:
screenName - Specfies 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.
Returns:
The ID or screen_name of the user to retrieve the friends ID list for.
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.10
See Also:
Twitter API Wiki / Twitter REST API Method: followers ids

verifyCredentials

public User verifyCredentials()
                       throws TwitterException
Returns an HTTP 200 OK response code and a representation of the requesting user if authentication was successful; returns a 401 status code and an error message if not. Use this method to test if supplied user credentials are valid.

Returns:
user
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.0
See Also:
Twitter API Wiki / Twitter REST API Method: account verify_credentials

updateLocation

public User updateLocation(java.lang.String location)
                    throws TwitterException
Deprecated. Use updateProfile(String name, String email, String url, String location, String description) instead

Updates the location

Parameters:
location - the current location of the user
Returns:
the updated user
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 1.0.4
See Also:
Twitter REST API Documentation > Account Methods > account/update_location

updateProfile

public User updateProfile(java.lang.String name,
                          java.lang.String email,
                          java.lang.String url,
                          java.lang.String location,
                          java.lang.String description)
                   throws TwitterException
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.

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.
Returns:
the updated user
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.2
See Also:
Twitter REST API Documentation > Account Methods > account/update_location

rateLimitStatus

public RateLimitStatus rateLimitStatus()
                                throws TwitterException
Returns 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.

Returns:
the rate limit status
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 1.1.4
See Also:
Twitter API Wiki / Twitter REST API Method: account rate_limit_status

updateDeliverlyDevice

public User updateDeliverlyDevice(Twitter.Device device)
                           throws TwitterException
Sets which device Twitter delivers updates to for the authenticating user. Sending none as the device parameter will disable IM or SMS updates.

Parameters:
device - new Delivery device. Must be one of: IM, SMS, NONE.
Returns:
the updated user
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 1.0.4
See Also:
Twitter API Wiki / Twitter REST API Method: account update_delivery_device

updateProfileColors

public User updateProfileColors(java.lang.String profileBackgroundColor,
                                java.lang.String profileTextColor,
                                java.lang.String profileLinkColor,
                                java.lang.String profileSidebarFillColor,
                                java.lang.String profileSidebarBorderColor)
                         throws TwitterException
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.

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
Returns:
the updated user
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.0
See Also:
Twitter API Wiki / Twitter REST API Method: account update_profile_colors

addParameterToList

private void addParameterToList(java.util.List<twitter4j.http.PostParameter> colors,
                                java.lang.String paramName,
                                java.lang.String color)

favorites

public java.util.List<Status> favorites()
                                 throws TwitterException
Deprecated. Use getFavorited() instead

Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.

Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: favorites

getFavorites

public java.util.List<Status> getFavorites()
                                    throws TwitterException
Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.

Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
Twitter API Wiki / Twitter REST API Method: favorites

favorites

public java.util.List<Status> favorites(int page)
                                 throws TwitterException
Deprecated. Use getFavorites(int page) instead

Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.

Parameters:
page - the number of page
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: favorites

getFavorites

public java.util.List<Status> getFavorites(int page)
                                    throws TwitterException
Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.

Parameters:
page - the number of page
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
Twitter API Wiki / Twitter REST API Method: favorites

favorites

public java.util.List<Status> favorites(java.lang.String id)
                                 throws TwitterException
Deprecated. Use getFavorites(String id) instead

Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.

Parameters:
id - the ID or screen name of the user for whom to request a list of favorite statuses
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: favorites

getFavorites

public java.util.List<Status> getFavorites(java.lang.String id)
                                    throws TwitterException
Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.

Parameters:
id - the ID or screen name of the user for whom to request a list of favorite statuses
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
Twitter API Wiki / Twitter REST API Method: favorites

favorites

public java.util.List<Status> favorites(java.lang.String id,
                                        int page)
                                 throws TwitterException
Deprecated. Use getFavorites(String id, int page) instead

Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.

Parameters:
id - the ID or screen name of the user for whom to request a list of favorite statuses
page - the number of page
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: favorites

getFavorites

public java.util.List<Status> getFavorites(java.lang.String id,
                                           int page)
                                    throws TwitterException
Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.

Parameters:
id - the ID or screen name of the user for whom to request a list of favorite statuses
page - the number of page
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
Twitter API Wiki / Twitter REST API Method: favorites

createFavorite

public Status createFavorite(long id)
                      throws TwitterException
Favorites the status specified in the ID parameter as the authenticating user. Returns the favorite status when successful.

Parameters:
id - the ID of the status to favorite
Returns:
Status
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: favorites create

destroyFavorite

public Status destroyFavorite(long id)
                       throws TwitterException
Un-favorites the status specified in the ID parameter as the authenticating user. Returns the un-favorited status in the requested format when successful.

Parameters:
id - the ID of the status to un-favorite
Returns:
Status
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: favorites destroy

follow

public User follow(java.lang.String id)
            throws TwitterException
Deprecated. Use enableNotification(String id) instead

Enables notifications for updates from the specified user to the authenticating user. Returns the specified user when successful.

Parameters:
id - String
Returns:
User
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: notifications follow

enableNotification

public User enableNotification(java.lang.String id)
                        throws TwitterException
Enables notifications for updates from the specified user to the authenticating user. Returns the specified user when successful.

Parameters:
id - String
Returns:
User
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
Twitter API Wiki / Twitter REST API Method: notifications follow

leave

public User leave(java.lang.String id)
           throws TwitterException
Deprecated. Use disableNotification(String id) instead

Disables notifications for updates from the specified user to the authenticating user. Returns the specified user when successful.

Parameters:
id - String
Returns:
User
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
Twitter API Wiki / Twitter REST API Method: notifications leave

disableNotification

public User disableNotification(java.lang.String id)
                         throws TwitterException
Disables notifications for updates from the specified user to the authenticating user. Returns the specified user when successful.

Parameters:
id - String
Returns:
User
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
Twitter API Wiki / Twitter REST API Method: notifications leave

block

public User block(java.lang.String id)
           throws TwitterException
Deprecated. Use createBlock(String id) instead

Blocks the user specified in the ID parameter as the authenticating user. Returns the blocked user in the requested format when successful.

Parameters:
id - the ID or screen_name of the user to block
Returns:
the blocked user
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 1.0.4
See Also:
Twitter API Wiki / Twitter REST API Method: blocks create

createBlock

public User createBlock(java.lang.String id)
                 throws TwitterException
Blocks the user specified in the ID parameter as the authenticating user. Returns the blocked user in the requested format when successful.

Parameters:
id - the ID or screen_name of the user to block
Returns:
the blocked user
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
Twitter API Wiki / Twitter REST API Method: blocks create

unblock

public User unblock(java.lang.String id)
             throws TwitterException
Deprecated. Use destroyBlock(String id) instead

Un-blocks the user specified in the ID parameter as the authenticating user. Returns the un-blocked user in the requested format when successful.

Parameters:
id - the ID or screen_name of the user to block
Returns:
the unblocked user
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 1.0.4
See Also:
Twitter API Wiki / Twitter REST API Method: blocks destroy

destroyBlock

public User destroyBlock(java.lang.String id)
                  throws TwitterException
Un-blocks the user specified in the ID parameter as the authenticating user. Returns the un-blocked user in the requested format when successful.

Parameters:
id - the ID or screen_name of the user to block
Returns:
the unblocked user
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.1
See Also:
Twitter API Wiki / Twitter REST API Method: blocks destroy

existsBlock

public boolean existsBlock(java.lang.String id)
                    throws TwitterException
Tests if a friendship exists between two users.
This method calls http://twitter.com/blocks/exists/id.xml

Parameters:
id - The ID or screen_name of the potentially blocked user.
Returns:
if the authenticating user is blocking a target user
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.4
See Also:
Twitter API Wiki / Twitter REST API Method: blocks exists

getBlockingUsers

public java.util.List<User> getBlockingUsers()
                                      throws TwitterException
Returns a list of user objects that the authenticating user is blocking.
This method calls http://twitter.com/blocks/blocking.xml

Returns:
a list of user objects that the authenticating user
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.4
See Also:
Twitter API Wiki / Twitter REST API Method: blocks blocking

getBlockingUsers

public java.util.List<User> getBlockingUsers(int page)
                                      throws TwitterException
Returns a list of user objects that the authenticating user is blocking.
This method calls http://twitter.com/blocks/blocking.xml

Parameters:
page - the number of page
Returns:
a list of user objects that the authenticating user
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.4
See Also:
Twitter API Wiki / Twitter REST API Method: blocks blocking

getBlockingUsersIDs

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

Returns:
Returns an array of numeric user ids the authenticating user is blocking.
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.4
See Also:
Twitter API Wiki / Twitter REST API Method: blocks blocking ids

getSavedSearches

public java.util.List<SavedSearch> getSavedSearches()
                                             throws TwitterException
Returns the authenticated user's saved search queries.
This method calls http://twitter.com/saved_searches.json

Returns:
Returns an array of numeric user ids the authenticating user is blocking.
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.8
See Also:
Twitter API Wiki / Twitter REST API Method: saved_searches

showSavedSearch

public SavedSearch showSavedSearch(int id)
                            throws TwitterException
Retrieve the data for a saved search owned by the authenticating user specified by the given id.
This method calls http://twitter.com/saved_searches/show/id.json

Parameters:
id - The id of the saved search to be retrieved.
Returns:
the data for a saved search
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.8
See Also:
Twitter API Wiki / Twitter REST API Method: saved_searches show

createSavedSearch

public SavedSearch createSavedSearch(java.lang.String query)
                              throws TwitterException
Retrieve the data for a saved search owned by the authenticating user specified by the given id.
This method calls http://twitter.com/saved_searches/saved_searches/create.json

Returns:
the data for a created saved search
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.8
See Also:
Twitter API Wiki / Twitter REST API Method: saved_searches create

destroySavedSearch

public SavedSearch destroySavedSearch(int id)
                               throws TwitterException
Destroys a saved search for the authenticated user. The search specified by id must be owned by the authenticating user.
This method calls http://twitter.com/saved_searches/destroy/id.json

Parameters:
id - The id of the saved search to be deleted.
Returns:
the data for a destroyed saved search
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.0.8
See Also:
Twitter API Wiki / Twitter REST API Method: saved_searches destroy

test

public boolean test()
             throws TwitterException
Returns the string "ok" in the requested format with a 200 OK HTTP status code.

Returns:
true if the API is working
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 1.0.4
See Also:
Twitter API Wiki / Twitter REST API Method: help test

getAuthenticatedUser

public User getAuthenticatedUser()
                          throws TwitterException
Deprecated. Use verifyCredentials() instead

Returns extended information of the authenticated user. This information includes design settings, so third party developers can theme their widgets according to a given user's preferences.
The call Twitter.getAuthenticatedUser() is equivalent to the call:
twitter.getUserDetail(twitter.getUserId());

Returns:
User
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 1.1.3

getDowntimeSchedule

public java.lang.String getDowntimeSchedule()
                                     throws TwitterException
Deprecated. this method is not supported by the Twitter API anymore

Returns the same text displayed on http://twitter.com/home when a maintenance window is scheduled, in the requested format.

Returns:
the schedule
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 1.0.4

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object