twitter4j
Class TwitterImpl

java.lang.Object
  extended by twitter4j.TwitterBaseImpl
      extended by twitter4j.TwitterImpl
All Implemented Interfaces:
java.io.Serializable, AccountMethods, BlockMethods, DirectMessageMethods, FavoriteMethods, FriendsFollowersMethods, FriendshipMethods, GeoMethods, HelpMethods, LegalResources, ListMembersMethods, ListMethods, ListSubscribersMethods, LocalTrendsMethods, NewTwitterMethods, NotificationMethods, SavedSearchesMethods, SearchMethods, SpamReportingMethods, StatusMethods, TimelineMethods, TrendsMethods, UserMethods, OAuthSupport, twitter4j.internal.http.HttpResponseListener, Twitter, TwitterBase

 class TwitterImpl
extends TwitterBaseImpl
implements Twitter

A java representation of the Twitter API
This class is thread safe and can be cached/re-used and used concurrently.
Currently this class is not carefully designed to be extended. It is suggested to extend this class only for mock testing purporse.

Author:
Yusuke Yamamoto - yusuke at mac.com

Field Summary
private  twitter4j.internal.http.HttpParameter INCLUDE_ENTITIES
           
private  twitter4j.internal.http.HttpParameter INCLUDE_RTS
           
private static long serialVersionUID
           
 
Fields inherited from class twitter4j.TwitterBaseImpl
auth, conf, http, id, screenName
 
Constructor Summary
TwitterImpl(Configuration conf, Authorization auth)
           
 
Method Summary
private  void addParameterToList(java.util.List<twitter4j.internal.http.HttpParameter> colors, java.lang.String paramName, java.lang.String color)
           
 UserList addUserListMember(int listId, long userId)
          Adds a member to a list.
 UserList addUserListMembers(int listId, long[] userIds)
          Adds multiple members to a list, by specifying a comma-separated list of member ids or screen names.
 UserList addUserListMembers(int listId, java.lang.String[] screenNames)
          Adds multiple members to a list, by specifying a comma-separated list of member ids or screen names.
private  void checkFileValidity(java.io.File image)
          Check the existence, and the type of the specified file.
 User checkUserListMembership(java.lang.String listOwnerScreenName, int listId, long userId)
          Check if a user is a member of the specified list.

This method calls http://api.twitter.com/1/[listOwner]/[listId]/members/id.json
 User checkUserListSubscription(java.lang.String listOwnerScreenName, int listId, long userId)
          Check if the specified user is a subscriber of the specified list.
 User createBlock(long userId)
          Blocks the user specified in the ID parameter as the authenticating user.
 User createBlock(java.lang.String screenName)
          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(long userId)
          Allows the authenticating users to follow the user specified in the ID parameter.
Returns the befriended user in the requested format when successful.
 User createFriendship(long userId, boolean follow)
          Allows the authenticating users to follow the user specified in the ID parameter.
Returns the befriended user in the requested format when successful.
 User createFriendship(java.lang.String screenName)
          Allows the authenticating users to follow the user specified in the ID parameter.
Returns the befriended user in the requested format when successful.
 User createFriendship(java.lang.String screenName, boolean follow)
          Allows the authenticating users to follow the user specified in the ID parameter.
Returns the befriended user in the requested format when successful.
 Place createPlace(java.lang.String name, java.lang.String containedWithin, java.lang.String token, GeoLocation location, java.lang.String streetAddress)
          Creates a new place at the given latitude and longitude.
 SavedSearch createSavedSearch(java.lang.String query)
          Creates a saved search for the authenticated user.
 UserList createUserList(java.lang.String listName, boolean isPublicList, java.lang.String description)
          Creates a new list for the authenticated user.
 UserList deleteUserListMember(int listId, long userId)
          Removes the specified member from the list.
 User destroyBlock(long userId)
          Un-blocks the user specified in the ID parameter as the authenticating user.
 User destroyBlock(java.lang.String screen_name)
          Un-blocks the user specified in the ID parameter as the authenticating user.
 DirectMessage destroyDirectMessage(long 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(long userId)
          Allows the authenticating users to unfollow the user specified in the ID parameter.
Returns the unfollowed user in the requested format when successful.
 User destroyFriendship(java.lang.String screenName)
          Allows the authenticating users to unfollow the user specified in the ID parameter.
Returns the unfollowed user in the requested format when successful.
 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.
Usage note: The authenticating user must be the author of the specified status.
 UserList destroyUserList(int listId)
          Deletes the specified list.
 User disableNotification(long userId)
          Disables notifications for updates from the specified user to the authenticating user.
 User disableNotification(java.lang.String screenName)
          Disables notifications for updates from the specified user to the authenticating user.
 User enableNotification(long userId)
          Enables notifications for updates from the specified user to the authenticating user.
 User enableNotification(java.lang.String screenName)
          Enables notifications for updates from the specified user to the authenticating user.
 boolean equals(java.lang.Object o)
           
 boolean existsBlock(long userId)
          Returns if the authenticating user is blocking a target user.
 boolean existsBlock(java.lang.String screenName)
          Returns if the authenticating user is blocking a target user.
 boolean existsFriendship(java.lang.String userA, java.lang.String userB)
          Tests for the existence of friendship between two users.
 AccountSettings getAccountSettings()
          Returns the current trend, geo and sleep time information for the authenticating user.
 AccountTotals getAccountTotals()
          Returns the current count of friends, followers, updates (statuses) and favorites of the authenticating user.
 ResponseList<UserList> getAllUserLists(long userId)
          Returns all lists the authenticating or specified user subscribes to, including their own.
 ResponseList<UserList> getAllUserLists(java.lang.String screenName)
          Returns all lists the authenticating or specified user subscribes to, including their own.
 ResponseList<Location> getAvailableTrends()
          Returns the locations that Twitter has trending topic information for.
 ResponseList<Location> getAvailableTrends(GeoLocation location)
          Returns the sorted locations that Twitter has trending topic information for.
 ResponseList<User> getBlockingUsers()
          Returns a list of user objects that the authenticating user is blocking.
 ResponseList<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.
 ResponseList<DirectMessage> getDirectMessages()
          Returns a list of the direct messages sent to the authenticating user.
 ResponseList<DirectMessage> getDirectMessages(Paging paging)
          Returns a list of the direct messages sent to the authenticating user.
 ResponseList<Status> getFavorites()
          Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.
 ResponseList<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.
 ResponseList<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.
 ResponseList<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.
 IDs getFollowersIDs(long cursor)
          Returns an array of numeric IDs for every user the specified user is followed by.
 IDs getFollowersIDs(long userId, long cursor)
          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.
 PagableResponseList<User> getFollowersStatuses(long cursor)
          Returns the authenticating user's followers, each with current status inline.
 PagableResponseList<User> getFollowersStatuses(long userId, long cursor)
          Returns the specified user's followers, each with current status inline.
 PagableResponseList<User> getFollowersStatuses(java.lang.String screenName, long cursor)
          Returns the specified user's followers, each with current status inline.
 IDs getFriendsIDs(long cursor)
          Returns an array of numeric IDs for every user the authenticating user is following.
 IDs getFriendsIDs(long userId, long cursor)
          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.
 PagableResponseList<User> getFriendsStatuses(long cursor)
          Returns a user's friends, each with current status inline.
 PagableResponseList<User> getFriendsStatuses(long userId, long cursor)
          Returns a user's friends, each with current status inline.
 PagableResponseList<User> getFriendsStatuses(java.lang.String screenName, long cursor)
          Returns a user's friends, each with current status inline.
 ResponseList<Status> getFriendsTimeline()
          Returns the 20 most recent statuses posted by the authenticating user and that user's friends.
 ResponseList<Status> getFriendsTimeline(Paging paging)
          Returns the 20 most recent statuses posted by the authenticating user and that user's friends.
 Place getGeoDetails(java.lang.String id)
          Find out more details of a place that was returned from the GeoMethods.reverseGeoCode(twitter4j.GeoQuery) method.
 ResponseList<Status> getHomeTimeline()
          Returns the 20 most recent statuses, including retweets, posted by the authenticating user and that user's friends.
 ResponseList<Status> getHomeTimeline(Paging paging)
          Returns the 20 most recent statuses, including retweets, posted by the authenticating user and that user's friends.
 IDs getIncomingFriendships(long cursor)
          Returns an array of numeric IDs for every user who has a pending request to follow the authenticating user.
 Trends getLocationTrends(int woeid)
          Returns the top 10 trending topics for a specific location Twitter has trending topic information for.
 ResponseList<User> getMemberSuggestions(java.lang.String categorySlug)
          Access the users in a given category of the Twitter suggested user list and return their most recent status if they are not a protected user.
 ResponseList<Status> getMentions()
          Returns the 20 most recent mentions (status containing @username) for the authenticating user.
 ResponseList<Status> getMentions(Paging paging)
          Returns the 20 most recent mentions (status containing @username) for the authenticating user.
 IDs getOutgoingFriendships(long cursor)
          Returns an array of numeric IDs for every protected user for whom the authenticating user has a pending follow request.
 java.lang.String getPrivacyPolicy()
          Returns Twitter's Privacy Policy.
 ProfileImage getProfileImage(java.lang.String screenName, ProfileImage.ImageSize size)
          Access the profile image in various sizes for the user with the indicated screen_name.
 ResponseList<Status> getPublicTimeline()
          Returns the 20 most recent statuses from non-protected users who have set a custom user icon.
 RateLimitStatus getRateLimitStatus()
          Returns the remaining number of API requests available to the requesting user before the API limit is reached for the current hour.
 RelatedResults getRelatedResults(long statusId)
          If available, returns an array of replies and mentions related to the specified Tweet.
 ResponseList<User> getRetweetedBy(long statusId)
          Show user objects of up to 100 members who retweeted the status.
 IDs getRetweetedByIDs(long statusId)
          Show user ids of up to 100 users who retweeted the status represented by id
This method calls http://api.twitter.com/1/statuses/:id/retweeted_by/ids.format
 ResponseList<Status> getRetweetedByMe()
          Returns the 20 most recent retweets posted by the authenticating user.
 ResponseList<Status> getRetweetedByMe(Paging paging)
          Returns the 20 most recent retweets posted by the authenticating user.
 ResponseList<Status> getRetweetedByUser(long userId, Paging paging)
          Returns the 20 most recent retweets posted by the specified user.
 ResponseList<Status> getRetweetedByUser(java.lang.String screenName, Paging paging)
          Returns the 20 most recent retweets posted by the specified user.
 ResponseList<Status> getRetweetedToMe()
          Returns the 20 most recent retweets posted by the authenticating user's friends.
 ResponseList<Status> getRetweetedToMe(Paging paging)
          Returns the 20 most recent retweets posted by the authenticating user's friends.
 ResponseList<Status> getRetweetedToUser(long userId, Paging paging)
          Returns the 20 most recent retweets posted by users the specified user follows.
 ResponseList<Status> getRetweetedToUser(java.lang.String screenName, Paging paging)
          Returns the 20 most recent retweets posted by users the specified user follows.
 ResponseList<Status> getRetweets(long statusId)
          Returns up to 100 of the first retweets of a given tweet.
 ResponseList<Status> getRetweetsOfMe()
          Returns the 20 most recent tweets of the authenticated user that have been retweeted by others.
 ResponseList<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.
 ResponseList<DirectMessage> getSentDirectMessages()
          Returns a list of the direct messages sent by the authenticating user.
 ResponseList<DirectMessage> getSentDirectMessages(Paging paging)
          Returns a list of the direct messages sent by the authenticating user.
 SimilarPlaces getSimilarPlaces(GeoLocation location, java.lang.String name, java.lang.String containedWithin, java.lang.String streetAddress)
          Locates places near the given coordinates which are similar in name.
 ResponseList<Category> getSuggestedUserCategories()
          Access to Twitter's suggested user list.
 java.lang.String getTermsOfService()
          Returns Twitter's' Terms of Service.
 Trends getTrends()
          Returns the top ten topics that are currently trending on Twitter.
 PagableResponseList<User> getUserListMembers(long listOwnerId, int listId, long cursor)
          Returns the members of the specified list.
 PagableResponseList<User> getUserListMembers(java.lang.String listOwnerScreenName, int listId, long cursor)
          Returns the members of the specified list.
 PagableResponseList<UserList> getUserListMemberships(java.lang.String listMemberScreenName, long cursor)
          List the lists the specified user has been added to.
 PagableResponseList<UserList> getUserLists(java.lang.String listOwnerScreenName, long cursor)
          List the lists of the specified user.
 ResponseList<Status> getUserListStatuses(long listOwnerId, int id, Paging paging)
          Show tweet timeline for members of the specified list.
 ResponseList<Status> getUserListStatuses(java.lang.String listOwnerScreenName, int id, Paging paging)
          Show tweet timeline for members of the specified list.
 PagableResponseList<User> getUserListSubscribers(java.lang.String listOwnerScreenName, int listId, long cursor)
          Returns the subscribers of the specified list.
 PagableResponseList<UserList> getUserListSubscriptions(java.lang.String listOwnerScreenName, long cursor)
          List the lists the specified user follows.
 ResponseList<User> getUserSuggestions(java.lang.String categorySlug)
          Access the users in a given category of the Twitter suggested user list.
It is recommended that end clients cache this data for no more than one hour.
 ResponseList<Status> getUserTimeline()
          Returns the 20 most recent statuses posted from the authenticating user.
 ResponseList<Status> getUserTimeline(long userId)
          Returns the 20 most recent statuses posted from the authenticating user.
 ResponseList<Status> getUserTimeline(long userId, Paging paging)
          Returns the 20 most recent statuses posted from the authenticating user.
 ResponseList<Status> getUserTimeline(Paging paging)
          Returns the 20 most recent statuses posted from the authenticating user.
 ResponseList<Status> getUserTimeline(java.lang.String screenName)
          Returns the 20 most recent statuses posted from the authenticating user.
 ResponseList<Status> getUserTimeline(java.lang.String screenName, Paging paging)
          Returns the 20 most recent statuses posted from the authenticating user.
 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()
           
 ResponseList<Friendship> lookupFriendships(long[] ids)
          Returns the relationship of the authenticating user to the specified users.
 ResponseList<Friendship> lookupFriendships(java.lang.String[] screenNames)
          Returns the relationship of the authenticating user to the specified users.
 ResponseList<User> lookupUsers(long[] ids)
          Return up to 100 users worth of extended information, specified by either ID, screen name, or combination of the two.
 ResponseList<User> lookupUsers(java.lang.String[] screenNames)
          Return up to 100 users worth of extended information, specified by either ID, screen name, or combination of the two.
private  twitter4j.internal.http.HttpParameter[] mergeParameters(twitter4j.internal.http.HttpParameter[] params1, twitter4j.internal.http.HttpParameter params2)
           
private  twitter4j.internal.http.HttpParameter[] mergeParameters(twitter4j.internal.http.HttpParameter[] params1, twitter4j.internal.http.HttpParameter[] params2)
           
 User reportSpam(long userId)
          The user specified in the id is blocked by the authenticated user and reported as a spammer.
 User reportSpam(java.lang.String screenName)
          The user specified in the id is blocked by the authenticated user and reported as a spammer.
 Status retweetStatus(long statusId)
          Retweets a tweet.
 ResponseList<Place> reverseGeoCode(GeoQuery query)
          Search for places (cities and neighborhoods) that can be attached to a statuses/update.
 QueryResult search(Query query)
          Returns tweets that match a specified query.
 ResponseList<Place> searchPlaces(GeoQuery query)
          Search for places that can be attached to a statuses/update.
 ResponseList<User> searchUsers(java.lang.String query, int page)
          Run a search for users similar to the Find People button on Twitter.com; the same results returned by people search on Twitter.com will be returned by using this API.
Usage note: It is only possible to retrieve the first 1000 matches from this API.
 DirectMessage sendDirectMessage(long userId, java.lang.String text)
          Sends a new direct message to the specified user from the authenticating user.
 DirectMessage sendDirectMessage(java.lang.String screenName, java.lang.String text)
          Sends a new direct message to the specified user from the authenticating user.
 DirectMessage showDirectMessage(long id)
          Returns a single direct message, specified by an id parameter.
 Relationship showFriendship(long sourceId, long targetId)
          Returns detailed information about the relationship between two users.
 Relationship showFriendship(java.lang.String sourceScreenName, java.lang.String targetScreenName)
          Returns detailed information about the relationship between two users.
 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 below.
 User showUser(long userId)
          Returns extended information of a given user, specified by ID or screen name as per the required id parameter.
 User showUser(java.lang.String screenName)
          Returns extended information of a given user, specified by ID or screen name as per the required id parameter.
 UserList showUserList(java.lang.String listOwnerScreenName, int id)
          Show the specified list.
 UserList subscribeUserList(java.lang.String listOwnerScreenName, int listId)
          Make the authenticated user follow the specified list.
 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()
           
 UserList unsubscribeUserList(java.lang.String listOwnerScreenName, int listId)
          Unsubscribes the authenticated user form the specified list.
 Relationship updateFriendship(long userId, boolean enableDeviceNotification, boolean retweets)
          Allows you to enable or disable retweets and device notifications from the specified user.
 Relationship updateFriendship(java.lang.String screenName, boolean enableDeviceNotification, boolean retweets)
          Allows you to enable or disable retweets and device notifications from the specified user.
 User updateProfile(java.lang.String name, 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 updateProfileBackgroundImage(java.io.File image, boolean tile)
          Updates the authenticating user's profile background image.
 User updateProfileBackgroundImage(java.io.InputStream image, boolean tile)
          Updates the authenticating user's profile background image.
 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.
 User updateProfileImage(java.io.File image)
          Updates the authenticating user's profile image.
 User updateProfileImage(java.io.InputStream image)
          Updates the authenticating user's profile image.
 Status updateStatus(StatusUpdate latestStatus)
          Updates the authenticating user's status.
 Status updateStatus(java.lang.String status)
          Updates the authenticating user's status.
 UserList updateUserList(int listId, java.lang.String newListName, boolean isPublicList, java.lang.String newDescription)
          Updates the specified list.
 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.TwitterBaseImpl
addRateLimitStatusListener, ensureAuthorizationEnabled, ensureOAuthEnabled, fillInIDAndScreenName, getAuthorization, getConfiguration, getId, getOAuthAccessToken, getOAuthAccessToken, getOAuthAccessToken, getOAuthAccessToken, getOAuthAccessToken, getOAuthRequestToken, getOAuthRequestToken, getScreenName, httpResponseReceived, setOAuthAccessToken, setOAuthConsumer, shutdown
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface twitter4j.auth.OAuthSupport
getOAuthAccessToken, getOAuthAccessToken, getOAuthAccessToken, getOAuthAccessToken, getOAuthAccessToken, getOAuthRequestToken, getOAuthRequestToken, setOAuthAccessToken, setOAuthConsumer
 
Methods inherited from interface twitter4j.TwitterBase
addRateLimitStatusListener, getAuthorization, getConfiguration, getId, getScreenName, shutdown
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

INCLUDE_ENTITIES

private final twitter4j.internal.http.HttpParameter INCLUDE_ENTITIES

INCLUDE_RTS

private final twitter4j.internal.http.HttpParameter INCLUDE_RTS
Constructor Detail

TwitterImpl

TwitterImpl(Configuration conf,
            Authorization auth)
Method Detail

mergeParameters

private twitter4j.internal.http.HttpParameter[] mergeParameters(twitter4j.internal.http.HttpParameter[] params1,
                                                                twitter4j.internal.http.HttpParameter[] params2)

mergeParameters

private twitter4j.internal.http.HttpParameter[] mergeParameters(twitter4j.internal.http.HttpParameter[] params1,
                                                                twitter4j.internal.http.HttpParameter params2)

search

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

Specified by:
search in interface SearchMethods
Parameters:
query - - the search condition
Returns:
the result
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET search | dev.twitter.com, Twitter API / Search Operators

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.json

Specified by:
getTrends in interface TrendsMethods
Returns:
the result
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET trends | dev.twitter.com

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.json

Specified by:
getCurrentTrends in interface TrendsMethods
Returns:
the result
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET trends/current | dev.twitter.com

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.json

Specified by:
getCurrentTrends in interface TrendsMethods
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
See Also:
GET trends/current | dev.twitter.com

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.json

Specified by:
getDailyTrends in interface TrendsMethods
Returns:
the result
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET trends/daily | dev.twitter.com

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.json

Specified by:
getDailyTrends in interface TrendsMethods
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
See Also:
GET trends/daily | dev.twitter.com

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.json

Specified by:
getWeeklyTrends in interface TrendsMethods
Returns:
the result
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET trends/weekly | dev.twitter.com

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.json

Specified by:
getWeeklyTrends in interface TrendsMethods
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
See Also:
GET trends/weekly | dev.twitter.com

getPublicTimeline

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

Specified by:
getPublicTimeline in interface TimelineMethods
Returns:
list of statuses of the Public Timeline
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET statuses/public_timeline | dev.twitter.com

getHomeTimeline

public ResponseList<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.
Usage note: This home_timeline call is identical to statuses/friends_timeline, except that home_timeline also contains retweets, while statuses/friends_timeline does not for backwards compatibility reasons. In a future version of the API, statuses/friends_timeline will be deprected and replaced by home_timeline.
This method calls http://api.twitter.com/1/statuses/home_timeline

Specified by:
getHomeTimeline in interface TimelineMethods
Returns:
list of the home Timeline
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET statuses/home_timeline | dev.twitter.com

getHomeTimeline

public ResponseList<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.
Usage note: This home_timeline call is identical to statuses/friends_timeline, except that home_timeline also contains retweets, while statuses/friends_timeline does not for backwards compatibility reasons. In a future version of the API, statuses/friends_timeline will be deprected and replaced by home_timeline.
This method calls http://api.twitter.com/1/statuses/home_timeline

Specified by:
getHomeTimeline in interface TimelineMethods
Parameters:
paging - controls pagination. Supports since_id, max_id, count and page parameters.
Returns:
list of the home Timeline
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET statuses/home_timeline | dev.twitter.com

getFriendsTimeline

public ResponseList<Status> getFriendsTimeline()
                                        throws TwitterException
Returns the 20 most recent statuses posted by the authenticating user and that user's friends. This is the equivalent of /timeline/home on the Web.
This method calls http://api.twitter.com/1/statuses/friends_timeline

Specified by:
getFriendsTimeline in interface TimelineMethods
Returns:
list of the Friends Timeline
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET statuses/friends_timeline | dev.twitter.com

getFriendsTimeline

public ResponseList<Status> getFriendsTimeline(Paging paging)
                                        throws TwitterException
Returns the 20 most recent statuses posted by the authenticating user and that user's friends. This is the equivalent of /timeline/home on the Web.
This method calls http://api.twitter.com/1/statuses/friends_timeline

Specified by:
getFriendsTimeline in interface TimelineMethods
Parameters:
paging - controls pagination. Supports since_id, max_id, count and page parameters.
Returns:
list of the Friends Timeline
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET statuses/friends_timeline | dev.twitter.com

getUserTimeline

public ResponseList<Status> getUserTimeline(java.lang.String screenName,
                                            Paging paging)
                                     throws TwitterException
Returns the 20 most recent statuses posted from the authenticating user. It's also possible to request another user's timeline via the id parameter.
This is the equivalent of the Web / page for your own user, or the profile page for a third party.
For backwards compatibility reasons, retweets are stripped out of the user_timeline when calling in XML or JSON (they appear with 'RT' in RSS and Atom). If you'd like them included, you can merge them in from statuses retweeted_by_me.

This method calls http://api.twitter.com/1/statuses/user_timeline.json

Specified by:
getUserTimeline in interface TimelineMethods
Parameters:
screenName - specifies the screen name of the user for whom to return the user_timeline
paging - controls pagination. Supports since_id, max_id, count and page parameters.
Returns:
list of the user Timeline
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET statuses/user_timeline | dev.twitter.com

getUserTimeline

public ResponseList<Status> getUserTimeline(long userId,
                                            Paging paging)
                                     throws TwitterException
Returns the 20 most recent statuses posted from the authenticating user. It's also possible to request another user's timeline via the id parameter.
This is the equivalent of the Web / page for your own user, or the profile page for a third party.
For backwards compatibility reasons, retweets are stripped out of the user_timeline when calling in XML or JSON (they appear with 'RT' in RSS and Atom). If you'd like them included, you can merge them in from statuses retweeted_by_me.

This method calls http://api.twitter.com/1/statuses/user_timeline.json

Specified by:
getUserTimeline in interface TimelineMethods
Parameters:
userId - specifies the ID of the user for whom to return the user_timeline
paging - controls pagination. Supports since_id, max_id, count and page parameters.
Returns:
list of the user Timeline
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET statuses/user_timeline | dev.twitter.com

getUserTimeline

public ResponseList<Status> getUserTimeline(java.lang.String screenName)
                                     throws TwitterException
Returns the 20 most recent statuses posted from the authenticating user. It's also possible to request another user's timeline via the id parameter.
This is the equivalent of the Web / page for your own user, or the profile page for a third party.
For backwards compatibility reasons, retweets are stripped out of the user_timeline when calling in XML or JSON (they appear with 'RT' in RSS and Atom). If you'd like them included, you can merge them in from statuses retweeted_by_me.

This method calls http://api.twitter.com/1/statuses/user_timeline

Specified by:
getUserTimeline in interface TimelineMethods
Parameters:
screenName - specifies the 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:
GET statuses/user_timeline | dev.twitter.com

getUserTimeline

public ResponseList<Status> getUserTimeline(long userId)
                                     throws TwitterException
Returns the 20 most recent statuses posted from the authenticating user. It's also possible to request another user's timeline via the id parameter.
This is the equivalent of the Web / page for your own user, or the profile page for a third party.
For backwards compatibility reasons, retweets are stripped out of the user_timeline when calling in XML or JSON (they appear with 'RT' in RSS and Atom). If you'd like them included, you can merge them in from statuses retweeted_by_me.

This method calls http://api.twitter.com/1/statuses/user_timeline

Specified by:
getUserTimeline in interface TimelineMethods
Parameters:
userId - specifies the ID 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:
GET statuses/user_timeline | dev.twitter.com

getUserTimeline

public ResponseList<Status> getUserTimeline()
                                     throws TwitterException
Returns the 20 most recent statuses posted from the authenticating user. It's also possible to request another user's timeline via the id parameter.
This is the equivalent of the Web / page for your own user, or the profile page for a third party.
For backwards compatibility reasons, retweets are stripped out of the user_timeline when calling in XML or JSON (they appear with 'RT' in RSS and Atom). If you'd like them included, you can merge them in from statuses retweeted_by_me.

This method calls http://api.twitter.com/1/statuses/user_timeline

Specified by:
getUserTimeline in interface TimelineMethods
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:
GET statuses/user_timeline | dev.twitter.com

getUserTimeline

public ResponseList<Status> getUserTimeline(Paging paging)
                                     throws TwitterException
Returns the 20 most recent statuses posted from the authenticating user. It's also possible to request another user's timeline via the id parameter.
This is the equivalent of the Web / page for your own user, or the profile page for a third party.
For backwards compatibility reasons, retweets are stripped out of the user_timeline when calling in XML or JSON (they appear with 'RT' in RSS and Atom). If you'd like them included, you can merge them in from statuses retweeted_by_me.

This method calls http://api.twitter.com/1/statuses/user_timeline

Specified by:
getUserTimeline in interface TimelineMethods
Parameters:
paging - controls pagination. Supports since_id, max_id, count and page parameters.
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:
GET statuses/user_timeline | dev.twitter.com

getMentions

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

Specified by:
getMentions in interface TimelineMethods
Returns:
the 20 most recent replies
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET statuses/mentions | dev.twitter.com

getMentions

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

Specified by:
getMentions in interface TimelineMethods
Parameters:
paging - controls pagination. Supports since_id, max_id, count and page parameters.
Returns:
the 20 most recent replies
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET statuses/mentions | dev.twitter.com

getRetweetedByMe

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

Specified by:
getRetweetedByMe in interface TimelineMethods
Returns:
the 20 most recent retweets posted by the authenticating user
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET statuses/retweeted_by_me | dev.twitter.com

getRetweetedByMe

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

Specified by:
getRetweetedByMe in interface TimelineMethods
Parameters:
paging - controls pagination. Supports since_id, max_id, count and page parameters.
Returns:
the 20 most recent retweets posted by the authenticating user
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET statuses/retweeted_by_me | dev.twitter.com

getRetweetedToMe

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

Specified by:
getRetweetedToMe in interface TimelineMethods
Returns:
the 20 most recent retweets posted by the authenticating user's friends.
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET statuses/retweeted_to_me | dev.twitter.com

getRetweetedToMe

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

Specified by:
getRetweetedToMe in interface TimelineMethods
Parameters:
paging - controls pagination. Supports since_id, max_id, count and page parameters.
Returns:
the 20 most recent retweets posted by the authenticating user's friends.
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET statuses/retweeted_to_me | dev.twitter.com

getRetweetsOfMe

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

Specified by:
getRetweetsOfMe in interface TimelineMethods
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
See Also:
GET statuses/retweets_of_me | dev.twitter.com

getRetweetsOfMe

public ResponseList<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://api.twitter.com/1/statuses/retweets_of_me

Specified by:
getRetweetsOfMe in interface TimelineMethods
Parameters:
paging - controls pagination. Supports since_id, max_id, count and page parameters.
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
See Also:
GET statuses/retweets_of_me | dev.twitter.com

getRetweetedToUser

public ResponseList<Status> getRetweetedToUser(java.lang.String screenName,
                                               Paging paging)
                                        throws TwitterException
Returns the 20 most recent retweets posted by users the specified user follows. This method is identical to statuses/retweeted_to_me except you can choose the user to view.
This method has not been finalized and the interface is subject to change in incompatible ways.
This method calls http://api.twitter.com/1/statuses/retweeted_to_user

Specified by:
getRetweetedToUser in interface TimelineMethods
Parameters:
screenName - the user to view
paging - controls pagination. Supports since_id, max_id, count and page parameters.
Returns:
the 20 most recent retweets posted by the authenticating user's friends.
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
#newtwitter and the API - Twitter API Announcements | Google Group

getRetweetedToUser

public ResponseList<Status> getRetweetedToUser(long userId,
                                               Paging paging)
                                        throws TwitterException
Returns the 20 most recent retweets posted by users the specified user follows. This method is identical to statuses/retweeted_to_me except you can choose the user to view.
This method has not been finalized and the interface is subject to change in incompatible ways.
This method calls http://api.twitter.com/1/statuses/retweeted_to_user

Specified by:
getRetweetedToUser in interface TimelineMethods
Parameters:
userId - the user to view
paging - controls pagination. Supports since_id, max_id, count and page parameters.
Returns:
the 20 most recent retweets posted by the authenticating user's friends.
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
#newtwitter and the API - Twitter API Announcements | Google Group

getRetweetedByUser

public ResponseList<Status> getRetweetedByUser(java.lang.String screenName,
                                               Paging paging)
                                        throws TwitterException
Returns the 20 most recent retweets posted by the specified user. This method is identical to statuses/retweeted_by_me except you can choose the user to view.
This method has not been finalized and the interface is subject to change in incompatible ways.
This method calls http://api.twitter.com/1/statuses/retweeted_by_user

Specified by:
getRetweetedByUser in interface TimelineMethods
Parameters:
screenName - the user to view
paging - controls pagination. Supports since_id, max_id, count and page parameters.
Returns:
the 20 most recent retweets posted by the authenticating user
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
#newtwitter and the API - Twitter API Announcements | Google Group

getRetweetedByUser

public ResponseList<Status> getRetweetedByUser(long userId,
                                               Paging paging)
                                        throws TwitterException
Returns the 20 most recent retweets posted by the specified user. This method is identical to statuses/retweeted_by_me except you can choose the user to view.
This method has not been finalized and the interface is subject to change in incompatible ways.
This method calls http://api.twitter.com/1/statuses/retweeted_by_user

Specified by:
getRetweetedByUser in interface TimelineMethods
Parameters:
userId - the user to view
paging - controls pagination. Supports since_id, max_id, count and page parameters.
Returns:
the 20 most recent retweets posted by the authenticating user
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
#newtwitter and the API - Twitter API Announcements | Google Group

getRetweetedBy

public ResponseList<User> getRetweetedBy(long statusId)
                                  throws TwitterException
Show user objects of up to 100 members who retweeted the status.
This method calls http://api.twitter.com/1/statuses/:id/retweeted_by

Specified by:
getRetweetedBy in interface StatusMethods
Parameters:
statusId - The ID of the status you want to get retweeters of
Returns:
the list of users who retweeted your status
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET statuses/:id/retweeted_by | dev.twitter.com

getRetweetedByIDs

public IDs getRetweetedByIDs(long statusId)
                      throws TwitterException
Show user ids of up to 100 users who retweeted the status represented by id
This method calls http://api.twitter.com/1/statuses/:id/retweeted_by/ids.format

Specified by:
getRetweetedByIDs in interface StatusMethods
Parameters:
statusId - The ID of the status you want to get retweeters of
Returns:
IDs of users who retweeted the stats
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET statuses/:id/retweeted_by/ids | dev.twitter.com

showStatus

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

Specified by:
showStatus in interface StatusMethods
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:
GET statuses/show/:id | dev.twitter.com

updateStatus

public Status updateStatus(java.lang.String status)
                    throws TwitterException
Updates the authenticating user's status. A status update with text identical to the authenticating user's text identical to the authenticating user's current status will be ignored to prevent duplicates.
This method calls http://api.twitter.com/1/statuses/update

Specified by:
updateStatus in interface StatusMethods
Parameters:
status - the text of your status update
Returns:
the latest status
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
POST statuses/update | dev.twitter.com

updateStatus

public Status updateStatus(StatusUpdate latestStatus)
                    throws TwitterException
Updates the authenticating user's status. A status update with text identical to the authenticating user's text identical to the authenticating user's current status will be ignored to prevent duplicates.
This method calls http://api.twitter.com/1/statuses/update

Specified by:
updateStatus in interface StatusMethods
Parameters:
latestStatus - the latest status to be updated.
Returns:
the latest status
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
POST statuses/update | dev.twitter.com

destroyStatus

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

Specified by:
destroyStatus in interface StatusMethods
Parameters:
statusId - The ID of the status to destroy.
Returns:
the deleted status
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
POST statuses/destroy/:id | dev.twitter.com

retweetStatus

public Status retweetStatus(long statusId)
                     throws TwitterException
Retweets a tweet. Returns the original tweet with retweet details embedded.
This method calls http://api.twitter.com/1/statuses/retweet

Specified by:
retweetStatus in interface StatusMethods
Parameters:
statusId - The ID of the status to retweet.
Returns:
the retweeted status
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
POST statuses/retweet/:id | dev.twitter.com

getRetweets

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

Specified by:
getRetweets in interface StatusMethods
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
See Also:
Tweets Resources › statuses/retweets/:id

showUser

public User showUser(java.lang.String screenName)
              throws TwitterException
Returns extended information of a given user, specified by ID or screen name as per the required id parameter. The author's most recent status will be returned inline.
This method calls http://api.twitter.com/1/users/show.json

Specified by:
showUser in interface UserMethods
Parameters:
screenName - the screen name of the user for whom to request the detail
Returns:
User
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET users/show | dev.twitter.com

showUser

public User showUser(long userId)
              throws TwitterException
Returns extended information of a given user, specified by ID or screen name as per the required id parameter. The author's most recent status will be returned inline.
This method calls http://api.twitter.com/1/users/show.json

Specified by:
showUser in interface UserMethods
Parameters:
userId - the ID of the user for whom to request the detail
Returns:
users
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET users/show | dev.twitter.com

lookupUsers

public ResponseList<User> lookupUsers(java.lang.String[] screenNames)
                               throws TwitterException
Return up to 100 users worth of extended information, specified by either ID, screen name, or combination of the two. The author's most recent status (if the authenticating user has permission) will be returned inline.
This method calls http://api.twitter.com/1/users/lookup.json

Specified by:
lookupUsers in interface UserMethods
Parameters:
screenNames - Specifies the screen names of the users to return.
Returns:
users
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET users/lookup | dev.twitter.com

lookupUsers

public ResponseList<User> lookupUsers(long[] ids)
                               throws TwitterException
Return up to 100 users worth of extended information, specified by either ID, screen name, or combination of the two. The author's most recent status (if the authenticating user has permission) will be returned inline.
This method calls http://api.twitter.com/1/users/lookup.json

Specified by:
lookupUsers in interface UserMethods
Parameters:
ids - Specifies the screen names of the users to return.
Returns:
users
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET users/lookup | dev.twitter.com

searchUsers

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

Specified by:
searchUsers in interface UserMethods
Parameters:
query - The query to run against people search.
page - Specifies the page of results to retrieve. Number of statuses per page is fixed to 20.
Returns:
the list of Users matches the provided
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET users/search | dev.twitter.com

getSuggestedUserCategories

public ResponseList<Category> getSuggestedUserCategories()
                                                  throws TwitterException
Access to Twitter's suggested user list. This returns the list of suggested user categories. The category can be used in the users/suggestions/category endpoint to get the users in that category.
This method calls http://api.twitter.com/1/users/suggestions/:slug.json

Specified by:
getSuggestedUserCategories in interface UserMethods
Returns:
list of suggested user categories.
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET users/suggestions/:slug | dev.twitter.com

getUserSuggestions

public ResponseList<User> getUserSuggestions(java.lang.String categorySlug)
                                      throws TwitterException
Access the users in a given category of the Twitter suggested user list.
It is recommended that end clients cache this data for no more than one hour.
This method calls http://api.twitter.com/1/users/suggestions/:slug.json

Specified by:
getUserSuggestions in interface UserMethods
Parameters:
categorySlug - slug
Returns:
list of suggested users
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET users/suggestions/slug | dev.twitter.com

getMemberSuggestions

public ResponseList<User> getMemberSuggestions(java.lang.String categorySlug)
                                        throws TwitterException
Access the users in a given category of the Twitter suggested user list and return their most recent status if they are not a protected user.
This method has not been finalized and the interface is subject to change in incompatible ways.
This method calls http://api.twitter.com/1/users/suggestions/:slug/members.json

Specified by:
getMemberSuggestions in interface UserMethods
Parameters:
categorySlug - slug
Returns:
list of suggested users
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
#newtwitter and the API - Twitter API Announcements | Google Group

getProfileImage

public ProfileImage getProfileImage(java.lang.String screenName,
                                    ProfileImage.ImageSize size)
                             throws TwitterException
Access the profile image in various sizes for the user with the indicated screen_name. If no size is provided the normal image is returned. This resource does not return JSON or XML, but instead returns a 302 redirect to the actual image resource. This method should only be used by application developers to lookup or check the profile image URL for a user. This method must not be used as the image source URL presented to users of your application.
This method calls http://api.twitter.com/1/users/profile_image/:screen_name.json

Specified by:
getProfileImage in interface UserMethods
Parameters:
screenName - The screen name of the user for whom to return results for.
size - Specifies the size of image to fetch. Not specifying a size will give the default, normal size of 48px by 48px. Valid options include: BIGGER - 73px by 73px NORMAL - 48px by 48px MINI - 24px by 24px
Returns:
profile image
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET users/profile_image/:screen_name | dev.twitter.com

getFriendsStatuses

public PagableResponseList<User> getFriendsStatuses(long cursor)
                                             throws TwitterException
Returns a user's friends, each with current status inline. They are ordered by the order in which the user followed them, most recently followed first, 100 at a time. (Please note that the result set isn't guaranteed to be 100 every time as suspended users will be filtered out.)
This method calls http://api.twitter.com/1/statuses/friends.json

Specified by:
getFriendsStatuses in interface UserMethods
Parameters:
cursor - Breaks the results into pages. A single page contains 100 users. This is recommended for users who are followed by many other users. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list.
Returns:
the list of friends
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET statuses/friends | dev.twitter.com

getFriendsStatuses

public PagableResponseList<User> getFriendsStatuses(java.lang.String screenName,
                                                    long cursor)
                                             throws TwitterException
Returns a user's friends, each with current status inline. They are ordered by the order in which the user followed them, most recently followed first, 100 at a time. (Please note that the result set isn't guaranteed to be 100 every time as suspended users will be filtered out.)
This method calls http://api.twitter.com/1/statuses/friends.json

Specified by:
getFriendsStatuses in interface UserMethods
Parameters:
screenName - the screen name of the user for whom to request a list of friends
cursor - Breaks the results into pages. A single page contains 100 users. This is recommended for users who are followed by many other users. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list.
Returns:
the list of friends
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET statuses/friends | dev.twitter.com

getFriendsStatuses

public PagableResponseList<User> getFriendsStatuses(long userId,
                                                    long cursor)
                                             throws TwitterException
Returns a user's friends, each with current status inline. They are ordered by the order in which the user followed them, most recently followed first, 100 at a time. (Please note that the result set isn't guaranteed to be 100 every time as suspended users will be filtered out.)
This method calls http://api.twitter.com/1/statuses/friends.json

Specified by:
getFriendsStatuses in interface UserMethods
Parameters:
userId - the ID of the user for whom to request a list of friends
cursor - Breaks the results into pages. A single page contains 100 users. This is recommended for users who are followed by many other users. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list.
Returns:
the list of friends
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET statuses/friends | dev.twitter.com

getFollowersStatuses

public PagableResponseList<User> getFollowersStatuses(long cursor)
                                               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://api.twitter.com/1/statuses/followers.json

Specified by:
getFollowersStatuses in interface UserMethods
Parameters:
cursor - Breaks the results into pages. A single page contains 100 users. This is recommended for users who are followed by many other users. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list.
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET statuses/followers | dev.twitter.com

getFollowersStatuses

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

Specified by:
getFollowersStatuses in interface UserMethods
Parameters:
screenName - The screen name of the user for whom to request a list of followers.
cursor - Breaks the results into pages. A single page contains 100 users. This is recommended for users who are followed by many other users. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list.
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET statuses/followers | dev.twitter.com

getFollowersStatuses

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

Specified by:
getFollowersStatuses in interface UserMethods
Parameters:
userId - The ID of the user for whom to request a list of followers.
cursor - Breaks the results into pages. A single page contains 100 users. This is recommended for users who are followed by many other users. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list.
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET statuses/followers | dev.twitter.com

createUserList

public UserList createUserList(java.lang.String listName,
                               boolean isPublicList,
                               java.lang.String description)
                        throws TwitterException
Creates a new list for the authenticated user. Accounts are limited to 20 lists.
This method calls http://api.twitter.com/1/user/lists.json

Specified by:
createUserList in interface ListMethods
Parameters:
listName - The name of the list you are creating. Required.
isPublicList - set true if you wish to make a public list
description - The description of the list you are creating. Optional.
Returns:
the list that was created
Throws:
TwitterException - when Twitter service or network is unavailable, or the authenticated user already has 20 lists(TwitterException.getStatusCode() == 403).
See Also:
POST :user/lists | dev.twitter.com

updateUserList

public UserList updateUserList(int listId,
                               java.lang.String newListName,
                               boolean isPublicList,
                               java.lang.String newDescription)
                        throws TwitterException
Updates the specified list.
This method calls http://api.twitter.com/1/:user/lists/:id.json

Specified by:
updateUserList in interface ListMethods
Parameters:
listId - The id of the list to update.
newListName - What you'd like to change the list's name to.
isPublicList - Whether your list is public or private. Optional. Values can be public or private. Lists are public by default if no mode is specified.
newDescription - What you'd like to change the list description to.
Returns:
the updated list
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
POST :user/lists/:id | dev.twitter.com

getUserLists

public PagableResponseList<UserList> getUserLists(java.lang.String listOwnerScreenName,
                                                  long cursor)
                                           throws TwitterException
List the lists of the specified user. Private lists will be included if the authenticated users is the same as the user whose lists are being returned.
This method calls http://api.twitter.com/1/:user/lists.json

Specified by:
getUserLists in interface ListMethods
Parameters:
listOwnerScreenName - The screen name of the list owner
cursor - Breaks the results into pages. A single page contains 20 lists. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list.
Returns:
the list of lists
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET :user/lists | dev.twitter.com

showUserList

public UserList showUserList(java.lang.String listOwnerScreenName,
                             int id)
                      throws TwitterException
Show the specified list. Private lists will only be shown if the authenticated user owns the specified list.
This method calls http://api.twitter.com/1/:user/lists/:id.json

Specified by:
showUserList in interface ListMethods
Parameters:
listOwnerScreenName - The screen name of the list owner
id - The id of the list to show
Returns:
the specified list
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET :user/lists/:id | dev.twitter.com

destroyUserList

public UserList destroyUserList(int listId)
                         throws TwitterException
Deletes the specified list. Must be owned by the authenticated user.
This method calls http://api.twitter.com/1/:user/lists/:id.json

Specified by:
destroyUserList in interface ListMethods
Parameters:
listId - The id of the list to delete
Returns:
the deleted list
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
DELETE :user/lists/:id | dev.twitter.com

getUserListStatuses

public ResponseList<Status> getUserListStatuses(java.lang.String listOwnerScreenName,
                                                int id,
                                                Paging paging)
                                         throws TwitterException
Show tweet timeline for members of the specified list.
http://api.twitter.com/1/user/lists/list_id/statuses.json

Specified by:
getUserListStatuses in interface ListMethods
Parameters:
listOwnerScreenName - The screen name of the list owner
id - The id of the list to delete
paging - controls pagination. Supports since_id, max_id, count and page parameters.
Returns:
list of statuses for members of the specified list
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET :user/lists/:id/statuses | dev.twitter.com

getUserListStatuses

public ResponseList<Status> getUserListStatuses(long listOwnerId,
                                                int id,
                                                Paging paging)
                                         throws TwitterException
Show tweet timeline for members of the specified list.
http://api.twitter.com/1/user/lists/list_id/statuses.json

Specified by:
getUserListStatuses in interface ListMethods
Parameters:
listOwnerId - The id of the list owner
id - The id of the list to delete
paging - controls pagination. Supports since_id, max_id, count and page parameters.
Returns:
list of statuses for members of the specified list
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET :user/lists/:id/statuses | dev.twitter.com

getUserListMemberships

public PagableResponseList<UserList> getUserListMemberships(java.lang.String listMemberScreenName,
                                                            long cursor)
                                                     throws TwitterException
List the lists the specified user has been added to.
This method calls http://api.twitter.com/1/:user/lists/memberships.json

Specified by:
getUserListMemberships in interface ListMethods
Parameters:
listMemberScreenName - The screen name of the list member
cursor - Breaks the results into pages. A single page contains 20 lists. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list.
Returns:
the list of lists
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET :user/lists/memberships | dev.twitter.com

getUserListSubscriptions

public PagableResponseList<UserList> getUserListSubscriptions(java.lang.String listOwnerScreenName,
                                                              long cursor)
                                                       throws TwitterException
List the lists the specified user follows.
This method calls http://api.twitter.com/1/[user]/lists/subscriptions.json

Specified by:
getUserListSubscriptions in interface ListMethods
Parameters:
listOwnerScreenName - The screen name of the list owner
cursor - Breaks the results into pages. A single page contains 20 lists. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list.
Returns:
the list of lists
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET :user/lists/subscriptions | dev.twitter.com

getAllUserLists

public ResponseList<UserList> getAllUserLists(java.lang.String screenName)
                                       throws TwitterException
Returns all lists the authenticating or specified user subscribes to, including their own.
This method has not been finalized and the interface is subject to change in incompatible ways.
This method calls http://api.twitter.com/1/lists/all.json

Specified by:
getAllUserLists in interface ListMethods
Parameters:
screenName - screen name to look up
Returns:
list of lists
Throws:
TwitterException - when Twitter service or network is unavailable

getAllUserLists

public ResponseList<UserList> getAllUserLists(long userId)
                                       throws TwitterException
Returns all lists the authenticating or specified user subscribes to, including their own.
This method has not been finalized and the interface is subject to change in incompatible ways.
This method calls http://api.twitter.com/1/lists/all.json

Specified by:
getAllUserLists in interface ListMethods
Parameters:
userId - user id to look up
Returns:
list of lists
Throws:
TwitterException - when Twitter service or network is unavailable

getUserListMembers

public PagableResponseList<User> getUserListMembers(java.lang.String listOwnerScreenName,
                                                    int listId,
                                                    long cursor)
                                             throws TwitterException
Returns the members of the specified list.
This method calls http://api.twitter.com/1/[user]/[list_id]/members.json

Specified by:
getUserListMembers in interface ListMembersMethods
Parameters:
listOwnerScreenName - The screen name of the list owner
listId - The id of the list
cursor - Breaks the results into pages. A single page contains 20 lists. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list.
Returns:
the members of the specified list.
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET :user/:list_id/members | dev.twitter.com

getUserListMembers

public PagableResponseList<User> getUserListMembers(long listOwnerId,
                                                    int listId,
                                                    long cursor)
                                             throws TwitterException
Returns the members of the specified list.
This method calls http://api.twitter.com/1/[user]/[list_id]/members.json

Specified by:
getUserListMembers in interface ListMembersMethods
Parameters:
listOwnerId - The id of the list owner
listId - The id of the list
cursor - Breaks the results into pages. A single page contains 20 lists. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list.
Returns:
the members of the specified list.
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET :user/:list_id/members | dev.twitter.com

addUserListMember

public UserList addUserListMember(int listId,
                                  long userId)
                           throws TwitterException
Adds a member to a list. The authenticated user must own the list to be able to add members to it. Lists are limited to having 500 members.
This method calls http://api.twitter.com/1/[listOwner]/[listId]/members.json

Specified by:
addUserListMember in interface ListMembersMethods
Parameters:
listId - The id of the list.
userId - The id of the user to add as a member of the list.
Returns:
the updated list
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
POST :user/:list_id/members | dev.twitter.com

addUserListMembers

public UserList addUserListMembers(int listId,
                                   long[] userIds)
                            throws TwitterException
Adds multiple members to a list, by specifying a comma-separated list of member ids or screen names. The authenticated user must own the list to be able to add members to it. Lists are limited to having 500 members, and you are limited to adding up to 100 members to a list at a time with this method.
This method calls http://api.twitter.com/1/[user]/[list_id]/memgers/create_all.json

Specified by:
addUserListMembers in interface ListMembersMethods
Parameters:
listId - The id of the list.
userIds - The array of ids of the user to add as member of the list. up to 100 are allowed in a single request.
Throws:
TwitterException
See Also:
POST :user/:list_id/create_all | dev.twitter.com

addUserListMembers

public UserList addUserListMembers(int listId,
                                   java.lang.String[] screenNames)
                            throws TwitterException
Adds multiple members to a list, by specifying a comma-separated list of member ids or screen names. The authenticated user must own the list to be able to add members to it. Lists are limited to having 500 members, and you are limited to adding up to 100 members to a list at a time with this method.
This method calls http://api.twitter.com/1/[user]/[list_id]/members/create_all.json

Specified by:
addUserListMembers in interface ListMembersMethods
Parameters:
listId - The id of the list.
screenNames - The array of screen names of the user to add as member of the list. up to 100 are allowed in a single request.
Throws:
TwitterException
See Also:
POST :user/:list_id/create_all | dev.twitter.com

deleteUserListMember

public UserList deleteUserListMember(int listId,
                                     long userId)
                              throws TwitterException
Removes the specified member from the list. The authenticated user must be the list's owner to remove members from the list.
This method calls http://api.twitter.com/1/[listOwner]/[listId]/members.json

Specified by:
deleteUserListMember in interface ListMembersMethods
Parameters:
listId - The id of the list.
userId - The screen name of the member you wish to remove from the list.
Returns:
the updated list
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
DELETE :user/:id/members | dev.twitter.com

checkUserListMembership

public User checkUserListMembership(java.lang.String listOwnerScreenName,
                                    int listId,
                                    long userId)
                             throws TwitterException
Check if a user is a member of the specified list.

This method calls http://api.twitter.com/1/[listOwner]/[listId]/members/id.json

Specified by:
checkUserListMembership in interface ListMembersMethods
Parameters:
listOwnerScreenName - The screen name of the list owner
listId - The id of the list.
userId - The id of the user who you want to know is a member or not of the specified list.
Returns:
the updated list
Throws:
TwitterException - when Twitter service or network is unavailable , or the user is not a member of the specified list(TwitterException.getStatusCode() returns 404 in that case.)
See Also:
GET :user/:list_id/members/:id | dev.twitter.com

getUserListSubscribers

public PagableResponseList<User> getUserListSubscribers(java.lang.String listOwnerScreenName,
                                                        int listId,
                                                        long cursor)
                                                 throws TwitterException
Returns the subscribers of the specified list.
This method calls http://api.twitter.com/1/:user/:list_id/subscribers.json

Specified by:
getUserListSubscribers in interface ListSubscribersMethods
Parameters:
listOwnerScreenName - The screen name of the list owner
listId - The id of the list
cursor - Breaks the results into pages. A single page contains 20 lists. Provide a value of -1 to begin paging. Provide values as returned to in the response body's next_cursor and previous_cursor attributes to page back and forth in the list.
Returns:
the members of the specified list.
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET :user/:list_id/subscribers | dev.twitter.com

subscribeUserList

public UserList subscribeUserList(java.lang.String listOwnerScreenName,
                                  int listId)
                           throws TwitterException
Make the authenticated user follow the specified list.
This method calls http://api.twitter.com/1/:listOwner/:listId/subscribers.json

Specified by:
subscribeUserList in interface ListSubscribersMethods
Parameters:
listOwnerScreenName - The screen name of the list owner
listId - The id of the list.
Returns:
the updated list
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
POST :user/:list_id/subscribers | dev.twitter.com

unsubscribeUserList

public UserList unsubscribeUserList(java.lang.String listOwnerScreenName,
                                    int listId)
                             throws TwitterException
Unsubscribes the authenticated user form the specified list.
This method calls http://api.twitter.com/1/:listOwner/:listId/subscribers.json

Specified by:
unsubscribeUserList in interface ListSubscribersMethods
Parameters:
listOwnerScreenName - The screen name of the list owner
listId - The id of the list.
Returns:
the updated list
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
DELETE :user/:list_id/subscribers | dev.twitter.com

checkUserListSubscription

public User checkUserListSubscription(java.lang.String listOwnerScreenName,
                                      int listId,
                                      long userId)
                               throws TwitterException
Check if the specified user is a subscriber of the specified list.
This method calls http://api.twitter.com/1/:listOwner/:listId/subscribers/:userId.json

Specified by:
checkUserListSubscription in interface ListSubscribersMethods
Parameters:
listOwnerScreenName - The screen name of the list owner
listId - The id of the list.
userId - The id of the user who you want to know is a member or not of the specified list.
Returns:
the updated list
Throws:
TwitterException - when Twitter service or network is unavailable , or the user is not a member of the specified list(TwitterException.getStatusCode() returns 404 in that case.)
See Also:
GET :user/:list_id/subscribers/:id | dev.twitter.com

getDirectMessages

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

Specified by:
getDirectMessages in interface DirectMessageMethods
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET direct_messages | dev.twitter.com

getDirectMessages

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

Specified by:
getDirectMessages in interface DirectMessageMethods
Parameters:
paging - controls pagination. Supports since_id, max_id, count and page parameters.
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET direct_messages | dev.twitter.com

getSentDirectMessages

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

Specified by:
getSentDirectMessages in interface DirectMessageMethods
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET direct_messages/sent | dev.twitter.com

getSentDirectMessages

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

Specified by:
getSentDirectMessages in interface DirectMessageMethods
Parameters:
paging - controls pagination. Supports since_id, max_id, count and page parameters.
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET direct_messages/sent | dev.twitter.com

sendDirectMessage

public DirectMessage sendDirectMessage(java.lang.String screenName,
                                       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 trimmed if the length of the text is exceeding 140 characters.
This method calls http://api.twitter.com/1/direct_messages/new

Specified by:
sendDirectMessage in interface DirectMessageMethods
Parameters:
screenName - the screen name of the user to whom send the direct message
text - The text of your direct message.
Returns:
DirectMessage
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
POST direct_messages/new | dev.twitter.com

sendDirectMessage

public DirectMessage sendDirectMessage(long userId,
                                       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 trimmed if the length of the text is exceeding 140 characters.
This method calls http://api.twitter.com/1/direct_messages/new

Specified by:
sendDirectMessage in interface DirectMessageMethods
Parameters:
userId - the screen name of the user to whom send the direct message
text - The text of your direct message.
Returns:
DirectMessage
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
POST direct_messages/new | dev.twitter.com

destroyDirectMessage

public DirectMessage destroyDirectMessage(long 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://api.twitter.com/1/direct_messages/destroy

Specified by:
destroyDirectMessage in interface DirectMessageMethods
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:
POST direct_messages/destroy/:id | dev.twitter.com

showDirectMessage

public DirectMessage showDirectMessage(long id)
                                throws TwitterException
Returns a single direct message, specified by an id parameter.
This method has not been finalized and the interface is subject to change in incompatible ways.
This method calls http://api.twitter.com/1/direct_messages/show/:id.json

Specified by:
showDirectMessage in interface DirectMessageMethods
Parameters:
id - message id
Returns:
DirectMessage
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
#newtwitter and the API - Twitter API Announcements | Google Group

createFriendship

public User createFriendship(java.lang.String screenName)
                      throws TwitterException
Allows the authenticating users to follow the user specified in the ID parameter.
Returns the befriended user in the requested format when successful. Returns a string describing the failure condition when unsuccessful. If you are already friends with the user an HTTP 403 will be returned.
This method calls http://api.twitter.com/1/friendships/create/[id].json

Specified by:
createFriendship in interface FriendshipMethods
Parameters:
screenName - the screen name of the user to be befriended
Returns:
the befriended user
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
POST friendships/create | dev.twitter.com

createFriendship

public User createFriendship(long userId)
                      throws TwitterException
Allows the authenticating users to follow the user specified in the ID parameter.
Returns the befriended user in the requested format when successful. Returns a string describing the failure condition when unsuccessful. If you are already friends with the user an HTTP 403 will be returned.
This method calls http://api.twitter.com/1/friendships/create/[id].json

Specified by:
createFriendship in interface FriendshipMethods
Parameters:
userId - the ID of the user to be befriended
Returns:
the befriended user
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
POST friendships/create | dev.twitter.com

createFriendship

public User createFriendship(java.lang.String screenName,
                             boolean follow)
                      throws TwitterException
Allows the authenticating users to follow the user specified in the ID parameter.
Returns the befriended user in the requested format when successful. Returns a string describing the failure condition when unsuccessful. If you are already friends with the user an HTTP 403 will be returned.
This method calls http://api.twitter.com/1/friendships/create/[id].json

Specified by:
createFriendship in interface FriendshipMethods
Parameters:
screenName - the 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
See Also:
POST friendships/create | dev.twitter.com

createFriendship

public User createFriendship(long userId,
                             boolean follow)
                      throws TwitterException
Allows the authenticating users to follow the user specified in the ID parameter.
Returns the befriended user in the requested format when successful. Returns a string describing the failure condition when unsuccessful. If you are already friends with the user an HTTP 403 will be returned.
This method calls http://api.twitter.com/1/friendships/create/[id].json

Specified by:
createFriendship in interface FriendshipMethods
Parameters:
userId - the ID 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
See Also:
POST friendships/create | dev.twitter.com

destroyFriendship

public User destroyFriendship(java.lang.String screenName)
                       throws TwitterException
Allows the authenticating users to unfollow the user specified in the ID parameter.
Returns the unfollowed user in the requested format when successful. Returns a string describing the failure condition when unsuccessful.
This method calls http://api.twitter.com/1/friendships/destroy/[id].json

Specified by:
destroyFriendship in interface FriendshipMethods
Parameters:
screenName - the 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:
POST friendships/destroy | dev.twitter.com

destroyFriendship

public User destroyFriendship(long userId)
                       throws TwitterException
Allows the authenticating users to unfollow the user specified in the ID parameter.
Returns the unfollowed user in the requested format when successful. Returns a string describing the failure condition when unsuccessful.
This method calls http://api.twitter.com/1/friendships/destroy/[id].json

Specified by:
destroyFriendship in interface FriendshipMethods
Parameters:
userId - the ID of the user for whom to request a list of friends
Returns:
User
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
POST friendships/destroy | dev.twitter.com

existsFriendship

public boolean existsFriendship(java.lang.String userA,
                                java.lang.String userB)
                         throws TwitterException
Tests for the existence of friendship between two users. Will return true if user_a follows user_b, otherwise will return false.
This method calls http://api.twitter.com/1/friendships/exists.json

Specified by:
existsFriendship in interface FriendshipMethods
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:
GET friendships/exists | dev.twitter.com

showFriendship

public Relationship showFriendship(java.lang.String sourceScreenName,
                                   java.lang.String targetScreenName)
                            throws TwitterException
Returns detailed information about the relationship between two users.
This method calls http://api.twitter.com/1/friendships/show.json

Specified by:
showFriendship in interface FriendshipMethods
Parameters:
sourceScreenName - the screen name of the source user
targetScreenName - the screen name of the target user
Returns:
Relationship
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET friendships/show | dev.twitter.com

showFriendship

public Relationship showFriendship(long sourceId,
                                   long targetId)
                            throws TwitterException
Returns detailed information about the relationship between two users.
This method calls http://api.twitter.com/1/friendships/show.json

Specified by:
showFriendship in interface FriendshipMethods
Parameters:
sourceId - the ID of the source user
targetId - the ID of the target user
Returns:
Relationship
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET friendships/show | dev.twitter.com

getIncomingFriendships

public IDs getIncomingFriendships(long cursor)
                           throws TwitterException
Returns an array of numeric IDs for every user who has a pending request to follow the authenticating user.
This method calls http://api.twitter.com/1/friendships/incoming.json

Specified by:
getIncomingFriendships in interface FriendshipMethods
Parameters:
cursor - Breaks the results into pages. A single page contains 5000 identifiers. Provide a value of -1 to begin paging.
Returns:
an array of numeric IDs for every user who has a pending request to follow the authenticating user.
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET friendships/incoming | dev.twitter.com

getOutgoingFriendships

public IDs getOutgoingFriendships(long cursor)
                           throws TwitterException
Returns an array of numeric IDs for every protected user for whom the authenticating user has a pending follow request.
This method calls http://api.twitter.com/1/friendships/outgoing.json

Specified by:
getOutgoingFriendships in interface FriendshipMethods
Parameters:
cursor - Breaks the results into pages. A single page contains 5000 identifiers. Provide a value of -1 to begin paging.
Returns:
an array of numeric IDs for every protected user for whom the authenticating user has a pending follow request.
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET friendships/outgoing | dev.twitter.com

lookupFriendships

public ResponseList<Friendship> lookupFriendships(java.lang.String[] screenNames)
                                           throws TwitterException
Returns the relationship of the authenticating user to the specified users.
This method has not been finalized and the interface is subject to change in incompatible ways.
This method calls http://api.twitter.com/1/friendships/lookup.json

Specified by:
lookupFriendships in interface FriendshipMethods
Parameters:
screenNames - array of the screen names to lookup
Returns:
list of Relationships
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
#newtwitter and the API - Twitter API Announcements | Google Group

lookupFriendships

public ResponseList<Friendship> lookupFriendships(long[] ids)
                                           throws TwitterException
Returns the relationship of the authenticating user to the specified users.
This method has not been finalized and the interface is subject to change in incompatible ways.
This method calls http://api.twitter.com/1/friendships/lookup.json

Specified by:
lookupFriendships in interface FriendshipMethods
Parameters:
ids - array of the ids to lookup
Returns:
list of Relationships
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
#newtwitter and the API - Twitter API Announcements | Google Group

updateFriendship

public Relationship updateFriendship(java.lang.String screenName,
                                     boolean enableDeviceNotification,
                                     boolean retweets)
                              throws TwitterException
Allows you to enable or disable retweets and device notifications from the specified user.
This method has not been finalized and the interface is subject to change in incompatible ways.
This method calls http://api.twitter.com/1/friendships/update.json

Specified by:
updateFriendship in interface FriendshipMethods
Parameters:
screenName - screen name to update
enableDeviceNotification - set true to enable device notification
retweets - set true to enable retweets
Returns:
Relationship
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
#newtwitter and the API - Twitter API Announcements | Google Group

updateFriendship

public Relationship updateFriendship(long userId,
                                     boolean enableDeviceNotification,
                                     boolean retweets)
                              throws TwitterException
Allows you to enable or disable retweets and device notifications from the specified user.
This method has not been finalized and the interface is subject to change in incompatible ways.
This method calls http://api.twitter.com/1/friendships/update.json

Specified by:
updateFriendship in interface FriendshipMethods
Parameters:
userId - user id to update
enableDeviceNotification - set true to enable device notification
retweets - set true to enable retweets
Returns:
Relationship
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
#newtwitter and the API - Twitter API Announcements | Google Group

getFriendsIDs

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

Specified by:
getFriendsIDs in interface FriendsFollowersMethods
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
See Also:
GET friends/ids | dev.twitter.com

getFriendsIDs

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

Specified by:
getFriendsIDs in interface FriendsFollowersMethods
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
See Also:
GET friends/ids | dev.twitter.com

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.
This method calls http://api.twitter.com/1/friends/ids.json

Specified by:
getFriendsIDs in interface FriendsFollowersMethods
Parameters:
screenName - Specifies the screen name of the user for whom to return the friends list.
cursor - Specifies the page number of the results beginning at 1. A single page contains 5000 ids. This is recommended for users with large ID lists. If not provided all ids are returned.
Returns:
an array of numeric IDs for every user the specified user is following
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET friends/ids | dev.twitter.com

getFollowersIDs

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

Specified by:
getFollowersIDs in interface FriendsFollowersMethods
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
See Also:
GET followers/ids | dev.twitter.com

getFollowersIDs

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

Specified by:
getFollowersIDs in interface FriendsFollowersMethods
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
See Also:
GET followers/ids | dev.twitter.com

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.
This method calls http://api.twitter.com/1/followers/ids.json

Specified by:
getFollowersIDs in interface FriendsFollowersMethods
Parameters:
screenName - Specifies the screen name of the user for whom to return the followers list.
cursor - Specifies the page number of the results beginning at 1. A single page contains 5000 ids. This is recommended for users with large ID lists. If not provided all ids are returned.
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
See Also:
GET followers/ids | dev.twitter.com

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.
This method calls http://api.twitter.com/1/account/verify_credentials.json

Specified by:
verifyCredentials in interface AccountMethods
Returns:
user
Throws:
TwitterException - when Twitter service or network is unavailable, or if supplied credential is wrong (TwitterException.getStatusCode() == 401)
See Also:
GET account/verify_credentials | dev.twitter.com

getRateLimitStatus

public RateLimitStatus getRateLimitStatus()
                                   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.

This method calls http://api.twitter.com/1/account/rate_limit_status.json

Specified by:
getRateLimitStatus in interface AccountMethods
Returns:
the rate limit status
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET account/rate_limit_status | dev.twitter.com

updateProfile

public User updateProfile(java.lang.String name,
                          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.
This method calls http://api.twitter.com/1/account/update_profile.json

Specified by:
updateProfile in interface AccountMethods
Parameters:
name - Optional. Maximum of 20 characters.
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
See Also:
POST account/update_profile | dev.twitter.com

getAccountTotals

public AccountTotals getAccountTotals()
                               throws TwitterException
Returns the current count of friends, followers, updates (statuses) and favorites of the authenticating user.
This method has not been finalized and the interface is subject to change in incompatible ways.
This method calls http://api.twitter.com/1/account/totals.json

Specified by:
getAccountTotals in interface AccountMethods
Returns:
the current count of friends, followers, updates (statuses) and favorites of the authenticating user
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
#newtwitter and the API - Twitter API Announcements | Google Group

getAccountSettings

public AccountSettings getAccountSettings()
                                   throws TwitterException
Returns the current trend, geo and sleep time information for the authenticating user.
This method has not been finalized and the interface is subject to change in incompatible ways.
This method calls http://api.twitter.com/1/account/settings.json

Specified by:
getAccountSettings in interface AccountMethods
Returns:
the current trend, geo and sleep time information for the authenticating user.
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
#newtwitter and the API - Twitter API Announcements | Google Group

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. Each parameter's value must be a valid hexidecimal value, and may be either three or six characters (ex: #fff or #ffffff).
This method calls http://api.twitter.com/1/account/update_profile_colors.json

Specified by:
updateProfileColors in interface AccountMethods
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
See Also:
POST account/update_profile_colors | dev.twitter.com

addParameterToList

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

updateProfileImage

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

Specified by:
updateProfileImage in interface AccountMethods
Parameters:
image - Must be a valid GIF, JPG, or PNG image of less than 700 kilobytes in size. Images with width larger than 500 pixels will be scaled down.
Returns:
the updated user
Throws:
TwitterException - when Twitter service or network is unavailable, or when the specified file is not found (FileNotFoundException will be nested), or when the specified file object in not representing a file (IOException will be nested)
See Also:
POST account/update_profile_image | dev.twitter.com

updateProfileImage

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

Specified by:
updateProfileImage in interface AccountMethods
Parameters:
image - Must be a valid GIF, JPG, or PNG image of less than 700 kilobytes in size. Images with width larger than 500 pixels will be scaled down.
Returns:
the updated user
Throws:
TwitterException - when Twitter service or network is unavailable, or when the specified file is not found (FileNotFoundException will be nested), or when the specified file object in not representing a file (IOException will be nested)
See Also:
POST account/update_profile_image | dev.twitter.com

updateProfileBackgroundImage

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

Specified by:
updateProfileBackgroundImage in interface AccountMethods
Parameters:
image - Must be a valid GIF, JPG, or PNG image of less than 800 kilobytes in size. Images with width larger than 2048 pixels will be forceably scaled down.
tile - If set to true the background image will be displayed tiled. The image will not be tiled otherwise.
Returns:
the updated user
Throws:
TwitterException - when Twitter service or network is unavailable, or when the specified file is not found (FileNotFoundException will be nested), or when the specified file object in not representing a file (IOException will be nested)
See Also:
POST account/update_profile_background_image | dev.twitter.com

updateProfileBackgroundImage

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

Specified by:
updateProfileBackgroundImage in interface AccountMethods
Parameters:
image - Must be a valid GIF, JPG, or PNG image of less than 800 kilobytes in size. Images with width larger than 2048 pixels will be forceably scaled down.
tile - If set to true the background image will be displayed tiled. The image will not be tiled otherwise.
Returns:
the updated user
Throws:
TwitterException - when Twitter service or network is unavailable, or when the specified file is not found (FileNotFoundException will be nested), or when the specified file object in not representing a file (IOException will be nested)
See Also:
POST account/update_profile_background_image | dev.twitter.com

checkFileValidity

private void checkFileValidity(java.io.File image)
                        throws TwitterException
Check the existence, and the type of the specified file.

Parameters:
image - image to be uploaded
Throws:
TwitterException - when the specified file is not found (FileNotFoundException will be nested) , or when the specified file object is not representing a file(IOException will be nested).

getFavorites

public ResponseList<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.
This method calls http://api.twitter.com/1/favorites.json

Specified by:
getFavorites in interface FavoriteMethods
Returns:
List
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET favorites | dev.twitter.com

getFavorites

public ResponseList<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.
This method calls http://api.twitter.com/1/favorites.json

Specified by:
getFavorites in interface FavoriteMethods
Parameters:
page - the number of page
Returns:
ResponseList
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET favorites | dev.twitter.com

getFavorites

public ResponseList<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.

Specified by:
getFavorites in interface FavoriteMethods
Parameters:
id - the ID or screen name of the user for whom to request a list of favorite statuses
Returns:
ResponseList
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET favorites | dev.twitter.com

getFavorites

public ResponseList<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.
This method calls http://api.twitter.com/1/favorites/[id].json

Specified by:
getFavorites in interface FavoriteMethods
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:
ResponseList
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET favorites | dev.twitter.com

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.
This method calls http://api.twitter.com/1/favorites/create/[id].json

Specified by:
createFavorite in interface FavoriteMethods
Parameters:
id - the ID of the status to favorite
Returns:
Status
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
POST favorites/create/:id | dev.twitter.com

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.
This method calls http://api.twitter.com/1/favorites/destroy/[id].json

Specified by:
destroyFavorite in interface FavoriteMethods
Parameters:
id - the ID of the status to un-favorite
Returns:
Status
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
POST favorites/destroy/:id | dev.twitter.com

enableNotification

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

Specified by:
enableNotification in interface NotificationMethods
Parameters:
screenName - Specifies the screen name of the user to follow with device updates.
Returns:
User
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
POST notifications/follow | dev.twitter.com

enableNotification

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

Specified by:
enableNotification in interface NotificationMethods
Parameters:
userId - Specifies the ID of the user to follow with device updates.
Returns:
User
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
POST notifications/follow | dev.twitter.com

disableNotification

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

Specified by:
disableNotification in interface NotificationMethods
Parameters:
screenName - Specifies the screen name of the user to disable device notifications.
Returns:
User
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
POST notifications/leave | dev.twitter.com

disableNotification

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

Specified by:
disableNotification in interface NotificationMethods
Parameters:
userId - Specifies the ID of the user to disable device notifications.
Returns:
User
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
POST notifications/leave | dev.twitter.com

createBlock

public User createBlock(java.lang.String screenName)
                 throws TwitterException
Blocks the user specified in the ID parameter as the authenticating user. Returns the blocked user in the requested format when successful.
This method calls http://api.twitter.com/1/blocks/create/[id].json

Specified by:
createBlock in interface BlockMethods
Parameters:
screenName - the screen_name of the user to block
Returns:
the blocked user
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
POST blocks/create | dev.twitter.com

createBlock

public User createBlock(long userId)
                 throws TwitterException
Blocks the user specified in the ID parameter as the authenticating user. Returns the blocked user in the requested format when successful.
This method calls http://api.twitter.com/1/blocks/create/[id].json

Specified by:
createBlock in interface BlockMethods
Parameters:
userId - the ID of the user to block
Returns:
the blocked user
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
POST blocks/create | dev.twitter.com

destroyBlock

public User destroyBlock(java.lang.String screen_name)
                  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.
This method calls http://api.twitter.com/1/blocks/destroy/[id].json

Specified by:
destroyBlock in interface BlockMethods
Parameters:
screen_name - the screen_name of the user to block
Returns:
the unblocked user
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
POST blocks/destroy | dev.twitter.com

destroyBlock

public User destroyBlock(long userId)
                  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.
This method calls http://api.twitter.com/1/blocks/destroy/[id].json

Specified by:
destroyBlock in interface BlockMethods
Parameters:
userId - the ID of the user to block
Returns:
the unblocked user
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
POST blocks/destroy | dev.twitter.com

existsBlock

public boolean existsBlock(java.lang.String screenName)
                    throws TwitterException
Returns if the authenticating user is blocking a target user. Will return the blocked user's object if a block exists, and error with a HTTP 404 response code otherwise.
This method calls http://api.twitter.com/1/blocks/exists/[id].json

Specified by:
existsBlock in interface BlockMethods
Parameters:
screenName - The 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
See Also:
GET blocks/exists | dev.twitter.com

existsBlock

public boolean existsBlock(long userId)
                    throws TwitterException
Returns if the authenticating user is blocking a target user. Will return the blocked user's object if a block exists, and error with a HTTP 404 response code otherwise.
This method calls http://api.twitter.com/1/blocks/exists/[id].json

Specified by:
existsBlock in interface BlockMethods
Parameters:
userId - The ID of the potentially blocked user.
Returns:
if the authenticating user is blocking a target user
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET blocks/exists | dev.twitter.com

getBlockingUsers

public ResponseList<User> getBlockingUsers()
                                    throws TwitterException
Returns a list of user objects that the authenticating user is blocking.
This method calls http://api.twitter.com/1/blocks/blocking.json

Specified by:
getBlockingUsers in interface BlockMethods
Returns:
a list of user objects that the authenticating user
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET blocks/blocking | dev.twitter.com

getBlockingUsers

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

Specified by:
getBlockingUsers in interface BlockMethods
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
See Also:
GET blocks/blocking | dev.twitter.com

getBlockingUsersIDs

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

Specified by:
getBlockingUsersIDs in interface BlockMethods
Returns:
Returns an array of numeric user ids the authenticating user is blocking.
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET blocks/blocking/ids | dev.twitter.com

reportSpam

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

Specified by:
reportSpam in interface SpamReportingMethods
Parameters:
userId - The ID of the user you want to report as a spammer.
Returns:
The User reported as a spammer.
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
POST report_spam | dev.twitter.com

reportSpam

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

Specified by:
reportSpam in interface SpamReportingMethods
Parameters:
screenName - The screen name of the user you want to report as a spammer.
Returns:
The User reported as a spammer.
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
POST report_spam | dev.twitter.com

getSavedSearches

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

Specified by:
getSavedSearches in interface SavedSearchesMethods
Returns:
Returns an array of numeric user ids the authenticating user is blocking.
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET saved_searches | dev.twitter.com

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://api.twitter.com/1/saved_searches/show/:id.json

Specified by:
showSavedSearch in interface SavedSearchesMethods
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
See Also:
GET saved_searches/show/:id | dev.twitter.com

createSavedSearch

public SavedSearch createSavedSearch(java.lang.String query)
                              throws TwitterException
Creates a saved search for the authenticated user.
This method calls http://api.twitter.com/1/saved_searches/saved_searches/create.json

Specified by:
createSavedSearch in interface SavedSearchesMethods
Parameters:
query - the query string
Returns:
the data for a created saved search
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
POST saved_searches/create | dev.twitter.com

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://api.twitter.com/1/saved_searches/destroy/id.json

Specified by:
destroySavedSearch in interface SavedSearchesMethods
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
See Also:
POST saved_searches/destroy/:id | dev.twitter.com

getAvailableTrends

public ResponseList<Location> getAvailableTrends()
                                          throws TwitterException
Returns the locations that Twitter has trending topic information for. The response is an array of "locations" that encode the location's WOEID (a Yahoo! Where On Earth ID) and some other human-readable information such as a canonical name and country the location belongs in.
This method calls http://api.twitter.com/1/trends/available.json

Specified by:
getAvailableTrends in interface LocalTrendsMethods
Returns:
the locations
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET trends/available | dev.twitter.com

getAvailableTrends

public ResponseList<Location> getAvailableTrends(GeoLocation location)
                                          throws TwitterException
Returns the sorted locations that Twitter has trending topic information for. The response is an array of "locations" that encode the location's WOEID (a Yahoo! Where On Earth ID) and some other human-readable information such as a canonical name and country the location belongs in.
This method calls http://api.twitter.com/1/trends/available.json

Specified by:
getAvailableTrends in interface LocalTrendsMethods
Parameters:
location - the available trend locations will be sorted by distance to the lat and long passed in. The sort is nearest to furthest.
Returns:
the locations
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET trends/available | dev.twitter.com

getLocationTrends

public Trends getLocationTrends(int woeid)
                         throws TwitterException
Returns the top 10 trending topics for a specific location Twitter has trending topic information for. The response is an array of "trend" objects that encode the name of the trending topic, the query parameter that can be used to search for the topic on Search, and the direct URL that can be issued against Search. This information is cached for five minutes, and therefore users are discouraged from querying these endpoints faster than once every five minutes. Global trends information is also available from this API by using a WOEID of 1.
This method calls http://api.twitter.com/1/trends/:woeid.json

Specified by:
getLocationTrends in interface LocalTrendsMethods
Parameters:
woeid - The WOEID of the location to be querying for
Returns:
trends
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET trends/:woeid | dev.twitter.com

searchPlaces

public ResponseList<Place> searchPlaces(GeoQuery query)
                                 throws TwitterException
Search for places that can be attached to a statuses/update. Given a latitude and a longitude pair, an IP address, or a name, this request will return a list of all the valid places that can be used as the place_id when updating a status.
Conceptually, a query can be made from the user's location, retrieve a list of places, have the user validate the location he or she is at, and then send the ID of this location with a call to statuses/update.
This is the recommended method to use find places that can be attached to statuses/update. Unlike geo/reverse_geocode which provides raw data access, this endpoint can potentially re-order places with regards to the user who is authenticated. This approach is also preferred for interactive place matching with the user.
This method calls http://api.twitter.com/1/geo/search.json

Specified by:
searchPlaces in interface GeoMethods
Parameters:
query - search query
Returns:
places (cities and neighborhoods) that can be attached to a statuses/update
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET geo/search | dev.twitter.com

getSimilarPlaces

public SimilarPlaces getSimilarPlaces(GeoLocation location,
                                      java.lang.String name,
                                      java.lang.String containedWithin,
                                      java.lang.String streetAddress)
                               throws TwitterException
Locates places near the given coordinates which are similar in name.
Conceptually you would use this method to get a list of known places to choose from first. Then, if the desired place doesn't exist, make a request to post/geo/place to create a new one.
The token contained in the response is the token needed to be able to create a new place.
This method calls http://api.twitter.com/1/geo/similar_places.json

Specified by:
getSimilarPlaces in interface GeoMethods
Parameters:
location - The latitude and longitude to search around.
name - The name a place is known as.
containedWithin - optional: the place_id which you would like to restrict the search results to. Setting this value means only places within the given place_id will be found.
streetAddress - optional: This parameter searches for places which have this given street address. There are other well-known, and application specific attributes available. Custom attributes are also permitted. Learn more about Place Attributes.
Returns:
places (cities and neighborhoods) that can be attached to a statuses/update
Throws:
TwitterException - when Twitter service or network is unavailable

reverseGeoCode

public ResponseList<Place> reverseGeoCode(GeoQuery query)
                                   throws TwitterException
Search for places (cities and neighborhoods) that can be attached to a statuses/update. Given a latitude and a longitude, return a list of all the valid places that can be used as a place_id when updating a status. Conceptually, a query can be made from the user's location, retrieve a list of places, have the user validate the location he or she is at, and then send the ID of this location up with a call to statuses/update.
There are multiple granularities of places that can be returned -- "neighborhoods", "cities", etc. At this time, only United States data is available through this method.
This API call is meant to be an informative call and will deliver generalized results about geography.
This method calls http://api.twitter.com/1/geo/reverse_geocode.json

Specified by:
reverseGeoCode in interface GeoMethods
Parameters:
query - search query
Returns:
places (cities and neighborhoods) that can be attached to a statuses/update
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET geo/reverse_geocode | dev.twitter.com

getGeoDetails

public Place getGeoDetails(java.lang.String id)
                    throws TwitterException
Find out more details of a place that was returned from the GeoMethods.reverseGeoCode(twitter4j.GeoQuery) method.
This method calls http://api.twitter.com/1/geo/id/:id.json

Specified by:
getGeoDetails in interface GeoMethods
Parameters:
id - The ID of the location to query about.
Returns:
details of the specified place
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET geo/id/:place_id | dev.twitter.com

createPlace

public Place createPlace(java.lang.String name,
                         java.lang.String containedWithin,
                         java.lang.String token,
                         GeoLocation location,
                         java.lang.String streetAddress)
                  throws TwitterException
Creates a new place at the given latitude and longitude.
This method calls http://api.twitter.com/1/geo/place.json

Specified by:
createPlace in interface GeoMethods
Parameters:
name - The name a place is known as.
containedWithin - The place_id within which the new place can be found. Try and be as close as possible with the containing place. For example, for a room in a building, set the contained_within as the building place_id.
token - The token found in the response from geo/similar_places.
location - The latitude and longitude the place is located at.
streetAddress - optional: This parameter searches for places which have this given street address. There are other well-known, and application specific attributes available. Custom attributes are also permitted. Learn more about Place Attributes.
Returns:
the created place
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
POST geo/place | dev.twitter.com

getTermsOfService

public java.lang.String getTermsOfService()
                                   throws TwitterException
Returns Twitter's' Terms of Service.
This method calls http://api.twitter.com/1/legal/tos.json

Specified by:
getTermsOfService in interface LegalResources
Returns:
Terms of Service
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET legal/tos | dev.twitter.com

getPrivacyPolicy

public java.lang.String getPrivacyPolicy()
                                  throws TwitterException
Returns Twitter's Privacy Policy.
This method calls http://api.twitter.com/1/legal/privacy.json

Specified by:
getPrivacyPolicy in interface LegalResources
Returns:
privacy policy
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET legal/privacy | dev.twitter.com

getRelatedResults

public RelatedResults getRelatedResults(long statusId)
                                 throws TwitterException
If available, returns an array of replies and mentions related to the specified Tweet. There is no guarantee there will be any replies or mentions in the response. This method is only available to users who have access to #newtwitter.
This method has not been finalized and the interface is subject to change in incompatible ways.
This method calls http://api.twitter.com/1/related_results/show/:id

Specified by:
getRelatedResults in interface NewTwitterMethods
Parameters:
statusId - the numerical ID of the status you're trying to retrieve
Returns:
the related results of a given tweet
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
#newtwitter and the API - Twitter API Announcements | Google Group

test

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

Specified by:
test in interface HelpMethods
Returns:
true if the API is working
Throws:
TwitterException - when Twitter service or network is unavailable
See Also:
GET help/test | dev.twitter.com

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class TwitterBaseImpl

toString

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