|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecttwitter4j.Twitter
public class 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.
| Field Summary |
|---|
| Fields inherited from interface twitter4j.internal.http.HttpResponseCode |
|---|
BAD_GATEWAY, BAD_REQUEST, ENHANCE_YOUR_CLAIM, FORBIDDEN, FOUND, INTERNAL_SERVER_ERROR, MULTIPLE_CHOICES, NOT_ACCEPTABLE, NOT_FOUND, NOT_MODIFIED, OK, SERVICE_UNAVAILABLE, UNAUTHORIZED |
| Constructor Summary | |
|---|---|
Twitter()
Deprecated. use TwitterFactory.getInstance() instead |
|
Twitter(java.lang.String screenName,
java.lang.String password)
Deprecated. use TwitterFactory.getInstance(String,String) instead |
|
| Method Summary | |
|---|---|
UserList |
addUserListMember(int listId,
int userId)
Adds a member to a list. |
UserList |
addUserListMembers(int listId,
int[] 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. |
User |
checkUserListMembership(java.lang.String listOwnerScreenName,
int listId,
int 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,
int userId)
Check if the specified user is a subscriber of the specified list. |
User |
createBlock(int 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(int 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(int 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,
int userId)
Removes the specified member from the list. |
User |
destroyBlock(int 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(int 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(int 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(int 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(int 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(int 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. |
Authorization |
getAuthorization()
Returns the authorization scheme for this instance. The returned type will be either of BasicAuthorization, OAuthAuthorization, or NullAuthorization |
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. |
Configuration |
getConfiguration()
Returns the configuration associated with this instance |
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()
Returns an array of numeric IDs for every user the specified user is followed by. |
IDs |
getFollowersIDs(int userId)
Returns an array of numeric IDs for every user the specified user is followed by. |
IDs |
getFollowersIDs(int userId,
long cursor)
Returns an array of numeric IDs for every user the specified user is followed by. |
IDs |
getFollowersIDs(long cursor)
Returns an array of numeric IDs for every user the specified user is followed by. |
IDs |
getFollowersIDs(java.lang.String screenName)
Returns an array of numeric IDs for every user the specified user is followed by. |
IDs |
getFollowersIDs(java.lang.String screenName,
long cursor)
Returns an array of numeric IDs for every user the specified user is followed by. |
PagableResponseList<User> |
getFollowersStatuses()
Returns the authenticating user's followers, each with current status inline. |
PagableResponseList<User> |
getFollowersStatuses(int userId)
Returns the specified user's followers, each with current status inline. |
PagableResponseList<User> |
getFollowersStatuses(int userId,
long cursor)
Returns the specified user's followers, each with current status inline. |
PagableResponseList<User> |
getFollowersStatuses(long cursor)
Returns the authenticating user's followers, each with current status inline. |
PagableResponseList<User> |
getFollowersStatuses(java.lang.String screenName)
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()
Returns an array of numeric IDs for every user the authenticating user is following. |
IDs |
getFriendsIDs(int userId)
Returns an array of numeric IDs for every user the specified user is following. all IDs are attempted to be returned, but large sets of IDs will likely fail with timeout errors. |
IDs |
getFriendsIDs(int userId,
long cursor)
Returns an array of numeric IDs for every user the specified user is following. |
IDs |
getFriendsIDs(long cursor)
Returns an array of numeric IDs for every user the authenticating user is following. |
IDs |
getFriendsIDs(java.lang.String screenName)
Returns an array of numeric IDs for every user the specified user is following. |
IDs |
getFriendsIDs(java.lang.String screenName,
long cursor)
Returns an array of numeric IDs for every user the specified user is following. |
PagableResponseList<User> |
getFriendsStatuses()
Returns a user's friends, each with current status inline. |
PagableResponseList<User> |
getFriendsStatuses(int userId)
Returns a user's friends, each with current status inline. |
PagableResponseList<User> |
getFriendsStatuses(int userId,
long cursor)
Returns a user's friends, each with current status inline. |
PagableResponseList<User> |
getFriendsStatuses(long cursor)
Returns a user's friends, each with current status inline. |
PagableResponseList<User> |
getFriendsStatuses(java.lang.String screenName)
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 GeoMethodsAsync.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. |
int |
getId()
Returns authenticating user's user id. This method may internally call verifyCredentials() on the first invocation if - this instance is authenticated by Basic and email address is supplied instead of screen name, or - this instance is authenticated by OAuth. |
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. |
ResponseList<Place> |
getNearbyPlaces(GeoQuery query)
Search for places (cities and neighborhoods) that can be attached to a statuses/update. |
AccessToken |
getOAuthAccessToken()
Returns an access token associated with this instance. If no access token is associated with this instance, this will retrieve a new access token. |
AccessToken |
getOAuthAccessToken(RequestToken requestToken)
Retrieves an access token associated with the supplied request token and sets userId. |
AccessToken |
getOAuthAccessToken(RequestToken requestToken,
java.lang.String oauthVerifier)
Retrieves an access token associated with the supplied request token and sets userId. |
AccessToken |
getOAuthAccessToken(java.lang.String oauthVerifier)
Retrieves an access token. |
AccessToken |
getOAuthAccessToken(java.lang.String token,
java.lang.String tokenSecret)
Retrieves an access token associated with the supplied screen name and password using xAuth. In order to get access acquire AccessToken using xAuth, you must apply by sending an email to api@twitter.com — all other applications will receive an HTTP 401 error. |
AccessToken |
getOAuthAccessToken(java.lang.String token,
java.lang.String tokenSecret,
java.lang.String pin)
Retrieves an access token associated with the supplied request token. |
RequestToken |
getOAuthRequestToken()
Retrieves a request token |
RequestToken |
getOAuthRequestToken(java.lang.String callbackUrl)
Retrieves a request token |
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. |
ResponseList<User> |
getRetweetedBy(long statusId,
Paging paging)
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 |
IDs |
getRetweetedByIDs(long statusId,
Paging paging)
Show user ids of up to 100 users who retweeted the status. |
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(int 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(int 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. |
java.lang.String |
getScreenName()
Returns authenticating user's screen name. This method may internally call verifyCredentials() on the first invocation if - this instance is authenticated by Basic and email address is supplied instead of screen name, or - this instance is authenticated by OAuth. Note that this method returns a transiently cached (will be lost upon serialization) screen name while it is possible to change a user's screen name. |
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(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(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(int userId)
Returns the 20 most recent statuses posted from the authenticating user. |
ResponseList<Status> |
getUserTimeline(int 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()
|
void |
httpResponseReceived(twitter4j.internal.http.HttpResponseEvent event)
|
boolean |
isBasicAuthEnabled()
tests if the instance is authenticated by Basic |
boolean |
isOAuthEnabled()
tests if the instance is authenticated by Basic |
ResponseList<Friendship> |
lookupFriendships(int[] 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(int[] 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. |
User |
reportSpam(int 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(int 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. |
void |
setOAuthAccessToken(AccessToken accessToken)
Sets the access token |
void |
setOAuthAccessToken(java.lang.String token,
java.lang.String tokenSecret)
Deprecated. Use TwitterFactory.getInstance(twitter4j.http.Authorization) instead |
void |
setOAuthConsumer(java.lang.String consumerKey,
java.lang.String consumerSecret)
sets the OAuth consumer key and consumer secret |
void |
setRateLimitStatusListener(RateLimitStatusListener listener)
Registers a RateLimitStatusListener for account associated rate limits |
DirectMessage |
showDirectMessage(long id)
Returns a single direct message, specified by an id parameter. |
Relationship |
showFriendship(int sourceId,
int 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(int 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. |
void |
shutdown()
Free resources associated with this instance, should be called on all instances constructed. |
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. |
java.lang.String |
toString()
|
UserList |
unsubscribeUserList(java.lang.String listOwnerScreenName,
int listId)
Unsubscribes the authenticated user form the specified list. |
Relationship |
updateFriendship(int 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 |
updateProfile(java.lang.String name,
java.lang.String email,
java.lang.String url,
java.lang.String location,
java.lang.String description)
Sets values that users are able to set under the "Account" tab of their settings page. |
User |
updateProfileBackgroundImage(java.io.File 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. |
Status |
updateStatus(StatusUpdate latestStatus)
Updates the authenticating user's status. |
Status |
updateStatus(java.lang.String status)
Updates the authenticating user's status. |
Status |
updateStatus(java.lang.String status,
GeoLocation location)
Updates the authenticating user's status. |
Status |
updateStatus(java.lang.String status,
long inReplyToStatusId)
Updates the authenticating user's status. |
Status |
updateStatus(java.lang.String status,
long inReplyToStatusId,
GeoLocation location)
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 java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Twitter()
TwitterFactory.getInstance() instead
public Twitter(java.lang.String screenName,
java.lang.String password)
TwitterFactory.getInstance(String,String) instead
screenName - the screen name of the userpassword - the password of the user| Method Detail |
|---|
public java.lang.String getScreenName()
throws TwitterException,
java.lang.IllegalStateException
TwitterException - when verifyCredentials threw an exception.
java.lang.IllegalStateException - if no credentials are supplied. i.e.) this is an anonymous Twitter instance
public int getId()
throws TwitterException,
java.lang.IllegalStateException
TwitterException - when verifyCredentials threw an exception.
java.lang.IllegalStateException - if no credentials are supplied. i.e.) this is an anonymous Twitter instance
public QueryResult search(Query query)
throws TwitterException
search in interface SearchMethodsquery - - the search condition
TwitterException - when Twitter service or network is unavailable
public Trends getTrends()
throws TwitterException
getTrends in interface TrendsMethodsTwitterException - when Twitter service or network is unavailable
public Trends getCurrentTrends()
throws TwitterException
getCurrentTrends in interface TrendsMethodsTwitterException - when Twitter service or network is unavailable
public Trends getCurrentTrends(boolean excludeHashTags)
throws TwitterException
getCurrentTrends in interface TrendsMethodsexcludeHashTags - Setting this to true will remove all hashtags from the trends list.
TwitterException - when Twitter service or network is unavailable
public java.util.List<Trends> getDailyTrends()
throws TwitterException
getDailyTrends in interface TrendsMethodsTwitterException - when Twitter service or network is unavailable
public java.util.List<Trends> getDailyTrends(java.util.Date date,
boolean excludeHashTags)
throws TwitterException
getDailyTrends in interface TrendsMethodsdate - Permits specifying a start date for the report.excludeHashTags - Setting this to true will remove all hashtags from the trends list.
TwitterException - when Twitter service or network is unavailable
public java.util.List<Trends> getWeeklyTrends()
throws TwitterException
getWeeklyTrends in interface TrendsMethodsTwitterException - when Twitter service or network is unavailable
public java.util.List<Trends> getWeeklyTrends(java.util.Date date,
boolean excludeHashTags)
throws TwitterException
getWeeklyTrends in interface TrendsMethodsdate - Permits specifying a start date for the report.excludeHashTags - Setting this to true will remove all hashtags from the trends list.
TwitterException - when Twitter service or network is unavailable
public ResponseList<Status> getPublicTimeline()
throws TwitterException
getPublicTimeline in interface TimelineMethodsTwitterException - when Twitter service or network is unavailable
public ResponseList<Status> getHomeTimeline()
throws TwitterException
getHomeTimeline in interface TimelineMethodsTwitterException - when Twitter service or network is unavailable
public ResponseList<Status> getHomeTimeline(Paging paging)
throws TwitterException
getHomeTimeline in interface TimelineMethodspaging - controls pagination. Supports since_id, max_id, count and page parameters.
TwitterException - when Twitter service or network is unavailable
public ResponseList<Status> getFriendsTimeline()
throws TwitterException
getFriendsTimeline in interface TimelineMethodsTwitterException - when Twitter service or network is unavailable
public ResponseList<Status> getFriendsTimeline(Paging paging)
throws TwitterException
getFriendsTimeline in interface TimelineMethodspaging - controls pagination. Supports since_id, max_id, count and page parameters.
TwitterException - when Twitter service or network is unavailable
public ResponseList<Status> getUserTimeline(java.lang.String screenName,
Paging paging)
throws TwitterException
getUserTimeline in interface TimelineMethodsscreenName - specifies the screen name of the user for whom to return the user_timelinepaging - controls pagination. Supports since_id, max_id, count and page parameters.
TwitterException - when Twitter service or network is unavailable
public ResponseList<Status> getUserTimeline(int userId,
Paging paging)
throws TwitterException
getUserTimeline in interface TimelineMethodsuserId - specifies the ID of the user for whom to return the user_timelinepaging - controls pagination. Supports since_id, max_id, count and page parameters.
TwitterException - when Twitter service or network is unavailable
public ResponseList<Status> getUserTimeline(java.lang.String screenName)
throws TwitterException
getUserTimeline in interface TimelineMethodsscreenName - specifies the screen name of the user for whom to return the user_timeline
TwitterException - when Twitter service or network is unavailable
public ResponseList<Status> getUserTimeline(int userId)
throws TwitterException
getUserTimeline in interface TimelineMethodsuserId - specifies the ID of the user for whom to return the user_timeline
TwitterException - when Twitter service or network is unavailable
public ResponseList<Status> getUserTimeline()
throws TwitterException
getUserTimeline in interface TimelineMethodsTwitterException - when Twitter service or network is unavailable
public ResponseList<Status> getUserTimeline(Paging paging)
throws TwitterException
getUserTimeline in interface TimelineMethodspaging - controls pagination. Supports since_id, max_id, count and page parameters.
TwitterException - when Twitter service or network is unavailable
public ResponseList<Status> getMentions()
throws TwitterException
getMentions in interface TimelineMethodsTwitterException - when Twitter service or network is unavailable
public ResponseList<Status> getMentions(Paging paging)
throws TwitterException
getMentions in interface TimelineMethodspaging - controls pagination. Supports since_id, max_id, count and page parameters.
TwitterException - when Twitter service or network is unavailable
public ResponseList<Status> getRetweetedByMe()
throws TwitterException
getRetweetedByMe in interface TimelineMethodsTwitterException - when Twitter service or network is unavailable
public ResponseList<Status> getRetweetedByMe(Paging paging)
throws TwitterException
getRetweetedByMe in interface TimelineMethodspaging - controls pagination. Supports since_id, max_id, count and page parameters.
TwitterException - when Twitter service or network is unavailable
public ResponseList<Status> getRetweetedToMe()
throws TwitterException
getRetweetedToMe in interface TimelineMethodsTwitterException - when Twitter service or network is unavailable
public ResponseList<Status> getRetweetedToMe(Paging paging)
throws TwitterException
getRetweetedToMe in interface TimelineMethodspaging - controls pagination. Supports since_id, max_id, count and page parameters.
TwitterException - when Twitter service or network is unavailable
public ResponseList<Status> getRetweetsOfMe()
throws TwitterException
getRetweetsOfMe in interface TimelineMethodsTwitterException - when Twitter service or network is unavailable
public ResponseList<Status> getRetweetsOfMe(Paging paging)
throws TwitterException
getRetweetsOfMe in interface TimelineMethodspaging - controls pagination. Supports since_id, max_id, count and page parameters.
TwitterException - when Twitter service or network is unavailable
public ResponseList<Status> getRetweetedToUser(java.lang.String screenName,
Paging paging)
throws TwitterException
getRetweetedToUser in interface TimelineMethodsscreenName - the user to viewpaging - controls pagination. Supports since_id, max_id, count and page parameters.
TwitterException - when Twitter service or network is unavailable
public ResponseList<Status> getRetweetedToUser(int userId,
Paging paging)
throws TwitterException
getRetweetedToUser in interface TimelineMethodsuserId - the user to viewpaging - controls pagination. Supports since_id, max_id, count and page parameters.
TwitterException - when Twitter service or network is unavailable
public ResponseList<Status> getRetweetedByUser(java.lang.String screenName,
Paging paging)
throws TwitterException
getRetweetedByUser in interface TimelineMethodsscreenName - the user to viewpaging - controls pagination. Supports since_id, max_id, count and page parameters.
TwitterException - when Twitter service or network is unavailable
public ResponseList<Status> getRetweetedByUser(int userId,
Paging paging)
throws TwitterException
getRetweetedByUser in interface TimelineMethodsuserId - the user to viewpaging - controls pagination. Supports since_id, max_id, count and page parameters.
TwitterException - when Twitter service or network is unavailable
public ResponseList<User> getRetweetedBy(long statusId)
throws TwitterException
getRetweetedBy in interface StatusMethodsstatusId - The ID of the status you want to get retweeters of
TwitterException - when Twitter service or network is unavailable
public ResponseList<User> getRetweetedBy(long statusId,
Paging paging)
throws TwitterException
getRetweetedBy in interface StatusMethodsstatusId - The ID of the status you want to get retweeters ofpaging - specify your paging requirements
TwitterException - when Twitter service or network is unavailable
public IDs getRetweetedByIDs(long statusId)
throws TwitterException
getRetweetedByIDs in interface StatusMethodsstatusId - The ID of the status you want to get retweeters of
TwitterException - when Twitter service or network is unavailable
public IDs getRetweetedByIDs(long statusId,
Paging paging)
throws TwitterException
getRetweetedByIDs in interface StatusMethodsstatusId - The ID of the status you want to get retweeters ofpaging - specify your paging requirements
TwitterException - when Twitter service or network is unavailable
public Status showStatus(long id)
throws TwitterException
showStatus in interface StatusMethodsid - the numerical ID of the status you're trying to retrieve
TwitterException - when Twitter service or network is unavailable
public Status updateStatus(java.lang.String status)
throws TwitterException
updateStatus in interface StatusMethodsstatus - the text of your status update
TwitterException - when Twitter service or network is unavailable
public Status updateStatus(java.lang.String status,
GeoLocation location)
throws TwitterException
updateStatus in interface StatusMethodsstatus - the text of your status updatelocation - The location that this tweet refers to.
TwitterException - when Twitter service or network is unavailable
public Status updateStatus(java.lang.String status,
long inReplyToStatusId)
throws TwitterException
updateStatus in interface StatusMethodsstatus - the text of your status updateinReplyToStatusId - The ID of an existing status that the status to be posted is in reply to. This implicitly sets the in_reply_to_user_id attribute of the resulting status to the user ID of the message being replied to. Invalid/missing status IDs will be ignored.
TwitterException - when Twitter service or network is unavailable
public Status updateStatus(java.lang.String status,
long inReplyToStatusId,
GeoLocation location)
throws TwitterException
updateStatus in interface StatusMethodsstatus - the text of your status updateinReplyToStatusId - The ID of an existing status that the status to be posted is in reply to. This implicitly sets the in_reply_to_user_id attribute of the resulting status to the user ID of the message being replied to. Invalid/missing status IDs will be ignored.location - The location that this tweet refers to.
TwitterException - when Twitter service or network is unavailable
public Status updateStatus(StatusUpdate latestStatus)
throws TwitterException
updateStatus in interface StatusMethodslatestStatus - the latest status to be updated.
TwitterException - when Twitter service or network is unavailable
public Status destroyStatus(long statusId)
throws TwitterException
destroyStatus in interface StatusMethodsstatusId - The ID of the status to destroy.
TwitterException - when Twitter service or network is unavailable
public Status retweetStatus(long statusId)
throws TwitterException
retweetStatus in interface StatusMethodsstatusId - The ID of the status to retweet.
TwitterException - when Twitter service or network is unavailable
public ResponseList<Status> getRetweets(long statusId)
throws TwitterException
getRetweets in interface StatusMethodsstatusId - The numerical ID of the tweet you want the retweets of.
TwitterException - when Twitter service or network is unavailable
public User showUser(java.lang.String screenName)
throws TwitterException
showUser in interface UserMethodsscreenName - the screen name of the user for whom to request the detail
TwitterException - when Twitter service or network is unavailable
public User showUser(int userId)
throws TwitterException
showUser in interface UserMethodsuserId - the ID of the user for whom to request the detail
TwitterException - when Twitter service or network is unavailable
public ResponseList<User> lookupUsers(java.lang.String[] screenNames)
throws TwitterException
lookupUsers in interface UserMethodsscreenNames - Specifies the screen names of the users to return.
TwitterException - when Twitter service or network is unavailable
public ResponseList<User> lookupUsers(int[] ids)
throws TwitterException
lookupUsers in interface UserMethodsids - Specifies the screen names of the users to return.
TwitterException - when Twitter service or network is unavailable
public ResponseList<User> searchUsers(java.lang.String query,
int page)
throws TwitterException
searchUsers in interface UserMethodsquery - The query to run against people search.page - Specifies the page of results to retrieve. Number of statuses per page is fixed to 20.
TwitterException - when Twitter service or network is unavailable
public ResponseList<Category> getSuggestedUserCategories()
throws TwitterException
getSuggestedUserCategories in interface UserMethodsTwitterException - when Twitter service or network is unavailable
public ResponseList<User> getUserSuggestions(java.lang.String categorySlug)
throws TwitterException
getUserSuggestions in interface UserMethodscategorySlug - slug
TwitterException - when Twitter service or network is unavailable
public ResponseList<User> getMemberSuggestions(java.lang.String categorySlug)
throws TwitterException
getMemberSuggestions in interface UserMethodscategorySlug - slug
TwitterException - when Twitter service or network is unavailable
public ProfileImage getProfileImage(java.lang.String screenName,
ProfileImage.ImageSize size)
throws TwitterException
getProfileImage in interface UserMethodsscreenName - 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
TwitterException - when Twitter service or network is unavailable
public PagableResponseList<User> getFriendsStatuses()
throws TwitterException
getFriendsStatuses in interface UserMethodsTwitterException - when Twitter service or network is unavailable
public PagableResponseList<User> getFriendsStatuses(long cursor)
throws TwitterException
getFriendsStatuses in interface UserMethodscursor - 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.
TwitterException - when Twitter service or network is unavailable
public PagableResponseList<User> getFriendsStatuses(java.lang.String screenName)
throws TwitterException
getFriendsStatuses in interface UserMethodsscreenName - the screen name of the user for whom to request a list of friends
TwitterException - when Twitter service or network is unavailable
public PagableResponseList<User> getFriendsStatuses(int userId)
throws TwitterException
getFriendsStatuses in interface UserMethodsuserId - the ID of the user for whom to request a list of friends
TwitterException - when Twitter service or network is unavailable
public PagableResponseList<User> getFriendsStatuses(java.lang.String screenName,
long cursor)
throws TwitterException
getFriendsStatuses in interface UserMethodsscreenName - the screen name of the user for whom to request a list of friendscursor - 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.
TwitterException - when Twitter service or network is unavailable
public PagableResponseList<User> getFriendsStatuses(int userId,
long cursor)
throws TwitterException
getFriendsStatuses in interface UserMethodsuserId - the ID of the user for whom to request a list of friendscursor - 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.
TwitterException - when Twitter service or network is unavailable
public PagableResponseList<User> getFollowersStatuses()
throws TwitterException
getFollowersStatuses in interface UserMethodsTwitterException - when Twitter service or network is unavailable
public PagableResponseList<User> getFollowersStatuses(long cursor)
throws TwitterException
getFollowersStatuses in interface UserMethodscursor - 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.
TwitterException - when Twitter service or network is unavailable
public PagableResponseList<User> getFollowersStatuses(java.lang.String screenName)
throws TwitterException
getFollowersStatuses in interface UserMethodsscreenName - The screen name of the user for whom to request a list of followers.
TwitterException - when Twitter service or network is unavailable
public PagableResponseList<User> getFollowersStatuses(int userId)
throws TwitterException
getFollowersStatuses in interface UserMethodsuserId - The ID of the user for whom to request a list of followers.
TwitterException - when Twitter service or network is unavailable
public PagableResponseList<User> getFollowersStatuses(java.lang.String screenName,
long cursor)
throws TwitterException
getFollowersStatuses in interface UserMethodsscreenName - 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.
TwitterException - when Twitter service or network is unavailable
public PagableResponseList<User> getFollowersStatuses(int userId,
long cursor)
throws TwitterException
getFollowersStatuses in interface UserMethodsuserId - 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.
TwitterException - when Twitter service or network is unavailable
public UserList createUserList(java.lang.String listName,
boolean isPublicList,
java.lang.String description)
throws TwitterException
createUserList in interface ListMethodslistName - The name of the list you are creating. Required.isPublicList - set true if you wish to make a public listdescription - The description of the list you are creating. Optional.
TwitterException - when Twitter service or network is unavailable, or the authenticated user already has 20 lists(TwitterException.getStatusCode() == 403).
public UserList updateUserList(int listId,
java.lang.String newListName,
boolean isPublicList,
java.lang.String newDescription)
throws TwitterException
updateUserList in interface ListMethodslistId - 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.
TwitterException - when Twitter service or network is unavailable
public PagableResponseList<UserList> getUserLists(java.lang.String listOwnerScreenName,
long cursor)
throws TwitterException
getUserLists in interface ListMethodslistOwnerScreenName - The screen name of the list ownercursor - 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.
TwitterException - when Twitter service or network is unavailable
public UserList showUserList(java.lang.String listOwnerScreenName,
int id)
throws TwitterException
showUserList in interface ListMethodslistOwnerScreenName - The screen name of the list ownerid - The id of the list to show
TwitterException - when Twitter service or network is unavailable
public UserList destroyUserList(int listId)
throws TwitterException
destroyUserList in interface ListMethodslistId - The id of the list to delete
TwitterException - when Twitter service or network is unavailable
public ResponseList<Status> getUserListStatuses(java.lang.String listOwnerScreenName,
int id,
Paging paging)
throws TwitterException
getUserListStatuses in interface ListMethodslistOwnerScreenName - The screen name of the list ownerid - The id of the list to deletepaging - controls pagination. Supports since_id, max_id, count and page parameters.
TwitterException - when Twitter service or network is unavailable
public PagableResponseList<UserList> getUserListMemberships(java.lang.String listMemberScreenName,
long cursor)
throws TwitterException
getUserListMemberships in interface ListMethodslistMemberScreenName - The screen name of the list membercursor - 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.
TwitterException - when Twitter service or network is unavailable
public PagableResponseList<UserList> getUserListSubscriptions(java.lang.String listOwnerScreenName,
long cursor)
throws TwitterException
getUserListSubscriptions in interface ListMethodslistOwnerScreenName - The screen name of the list ownercursor - 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.
TwitterException - when Twitter service or network is unavailable
public ResponseList<UserList> getAllUserLists(java.lang.String screenName)
throws TwitterException
getAllUserLists in interface ListMethodsscreenName - screen name to look up
TwitterException - when Twitter service or network is unavailable
public ResponseList<UserList> getAllUserLists(int userId)
throws TwitterException
getAllUserLists in interface ListMethodsuserId - user id to look up
TwitterException - when Twitter service or network is unavailable
public PagableResponseList<User> getUserListMembers(java.lang.String listOwnerScreenName,
int listId,
long cursor)
throws TwitterException
getUserListMembers in interface ListMembersMethodslistOwnerScreenName - The screen name of the list ownerlistId - The id of the listcursor - 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.
TwitterException - when Twitter service or network is unavailable
public UserList addUserListMember(int listId,
int userId)
throws TwitterException
addUserListMember in interface ListMembersMethodslistId - The id of the list.userId - The id of the user to add as a member of the list.
TwitterException - when Twitter service or network is unavailable
public UserList addUserListMembers(int listId,
int[] userIds)
throws TwitterException
addUserListMembers in interface ListMembersMethodslistId - 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.
TwitterException
public UserList addUserListMembers(int listId,
java.lang.String[] screenNames)
throws TwitterException
addUserListMembers in interface ListMembersMethodslistId - 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.
TwitterException
public UserList deleteUserListMember(int listId,
int userId)
throws TwitterException
deleteUserListMember in interface ListMembersMethodslistId - The id of the list.userId - The screen name of the member you wish to remove from the list.
TwitterException - when Twitter service or network is unavailable
public User checkUserListMembership(java.lang.String listOwnerScreenName,
int listId,
int userId)
throws TwitterException
checkUserListMembership in interface ListMembersMethodslistOwnerScreenName - The screen name of the list ownerlistId - 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.
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.)
public PagableResponseList<User> getUserListSubscribers(java.lang.String listOwnerScreenName,
int listId,
long cursor)
throws TwitterException
getUserListSubscribers in interface ListSubscribersMethodslistOwnerScreenName - The screen name of the list ownerlistId - The id of the listcursor - 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.
TwitterException - when Twitter service or network is unavailable
public UserList subscribeUserList(java.lang.String listOwnerScreenName,
int listId)
throws TwitterException
subscribeUserList in interface ListSubscribersMethodslistOwnerScreenName - The screen name of the list ownerlistId - The id of the list.
TwitterException - when Twitter service or network is unavailable
public UserList unsubscribeUserList(java.lang.String listOwnerScreenName,
int listId)
throws TwitterException
unsubscribeUserList in interface ListSubscribersMethodslistOwnerScreenName - The screen name of the list ownerlistId - The id of the list.
TwitterException - when Twitter service or network is unavailable
public User checkUserListSubscription(java.lang.String listOwnerScreenName,
int listId,
int userId)
throws TwitterException
checkUserListSubscription in interface ListSubscribersMethodslistOwnerScreenName - The screen name of the list ownerlistId - 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.
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.)
public ResponseList<DirectMessage> getDirectMessages()
throws TwitterException
getDirectMessages in interface DirectMessageMethodsTwitterException - when Twitter service or network is unavailable
public ResponseList<DirectMessage> getDirectMessages(Paging paging)
throws TwitterException
getDirectMessages in interface DirectMessageMethodspaging - controls pagination. Supports since_id, max_id, count and page parameters.
TwitterException - when Twitter service or network is unavailable
public ResponseList<DirectMessage> getSentDirectMessages()
throws TwitterException
getSentDirectMessages in interface DirectMessageMethodsTwitterException - when Twitter service or network is unavailable
public ResponseList<DirectMessage> getSentDirectMessages(Paging paging)
throws TwitterException
getSentDirectMessages in interface DirectMessageMethodspaging - controls pagination. Supports since_id, max_id, count and page parameters.
TwitterException - when Twitter service or network is unavailable
public DirectMessage sendDirectMessage(java.lang.String screenName,
java.lang.String text)
throws TwitterException
sendDirectMessage in interface DirectMessageMethodsscreenName - the screen name of the user to whom send the direct messagetext - The text of your direct message.
TwitterException - when Twitter service or network is unavailable
public DirectMessage sendDirectMessage(int userId,
java.lang.String text)
throws TwitterException
sendDirectMessage in interface DirectMessageMethodsuserId - the screen name of the user to whom send the direct messagetext - The text of your direct message.
TwitterException - when Twitter service or network is unavailable
public DirectMessage destroyDirectMessage(long id)
throws TwitterException
destroyDirectMessage in interface DirectMessageMethodsid - the ID of the direct message to destroy
TwitterException - when Twitter service or network is unavailable
public DirectMessage showDirectMessage(long id)
throws TwitterException
showDirectMessage in interface DirectMessageMethodsid - message id
TwitterException - when Twitter service or network is unavailable
public User createFriendship(java.lang.String screenName)
throws TwitterException
createFriendship in interface FriendshipMethodsscreenName - the screen name of the user to be befriended
TwitterException - when Twitter service or network is unavailable
public User createFriendship(int userId)
throws TwitterException
createFriendship in interface FriendshipMethodsuserId - the ID of the user to be befriended
TwitterException - when Twitter service or network is unavailable
public User createFriendship(java.lang.String screenName,
boolean follow)
throws TwitterException
createFriendship in interface FriendshipMethodsscreenName - the screen name of the user to be befriendedfollow - Enable notifications for the target user in addition to becoming friends.
TwitterException - when Twitter service or network is unavailable
public User createFriendship(int userId,
boolean follow)
throws TwitterException
createFriendship in interface FriendshipMethodsuserId - the ID of the user to be befriendedfollow - Enable notifications for the target user in addition to becoming friends.
TwitterException - when Twitter service or network is unavailable
public User destroyFriendship(java.lang.String screenName)
throws TwitterException
destroyFriendship in interface FriendshipMethodsscreenName - the screen name of the user for whom to request a list of friends
TwitterException - when Twitter service or network is unavailable
public User destroyFriendship(int userId)
throws TwitterException
destroyFriendship in interface FriendshipMethodsuserId - the ID of the user for whom to request a list of friends
TwitterException - when Twitter service or network is unavailable
public boolean existsFriendship(java.lang.String userA,
java.lang.String userB)
throws TwitterException
existsFriendship in interface FriendshipMethodsuserA - 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.
TwitterException - when Twitter service or network is unavailable
public Relationship showFriendship(java.lang.String sourceScreenName,
java.lang.String targetScreenName)
throws TwitterException
showFriendship in interface FriendshipMethodssourceScreenName - the screen name of the source usertargetScreenName - the screen name of the target user
TwitterException - when Twitter service or network is unavailable
public Relationship showFriendship(int sourceId,
int targetId)
throws TwitterException
showFriendship in interface FriendshipMethodssourceId - the screen ID of the source usertargetId - the screen ID of the target user
TwitterException - when Twitter service or network is unavailable
public IDs getIncomingFriendships(long cursor)
throws TwitterException
getIncomingFriendships in interface FriendshipMethodscursor - Breaks the results into pages. A single page contains 5000 identifiers. Provide a value of -1 to begin paging.
TwitterException - when Twitter service or network is unavailable
public IDs getOutgoingFriendships(long cursor)
throws TwitterException
getOutgoingFriendships in interface FriendshipMethodscursor - Breaks the results into pages. A single page contains 5000 identifiers. Provide a value of -1 to begin paging.
TwitterException - when Twitter service or network is unavailable
public ResponseList<Friendship> lookupFriendships(java.lang.String[] screenNames)
throws TwitterException
lookupFriendships in interface FriendshipMethodsscreenNames - array of the screen names to lookup
TwitterException - when Twitter service or network is unavailable
public ResponseList<Friendship> lookupFriendships(int[] ids)
throws TwitterException
lookupFriendships in interface FriendshipMethodsids - array of the ids to lookup
TwitterException - when Twitter service or network is unavailable
public Relationship updateFriendship(java.lang.String screenName,
boolean enableDeviceNotification,
boolean retweets)
throws TwitterException
updateFriendship in interface FriendshipMethodsscreenName - screen name to updateenableDeviceNotification - set true to enable device notificationretweets - set true to enable retweets
TwitterException - when Twitter service or network is unavailable
public Relationship updateFriendship(int userId,
boolean enableDeviceNotification,
boolean retweets)
throws TwitterException
updateFriendship in interface FriendshipMethodsuserId - user id to updateenableDeviceNotification - set true to enable device notificationretweets - set true to enable retweets
TwitterException - when Twitter service or network is unavailable
public IDs getFriendsIDs()
throws TwitterException
getFriendsIDs in interface FriendsFollowersMethodsTwitterException - when Twitter service or network is unavailable
public IDs getFriendsIDs(long cursor)
throws TwitterException
getFriendsIDs in interface FriendsFollowersMethodscursor - 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.
TwitterException - when Twitter service or network is unavailable
public IDs getFriendsIDs(int userId)
throws TwitterException
getFriendsIDs in interface FriendsFollowersMethodsuserId - Specifies the ID of the user for whom to return the friends list.
TwitterException - when Twitter service or network is unavailable
public IDs getFriendsIDs(int userId,
long cursor)
throws TwitterException
getFriendsIDs in interface FriendsFollowersMethodsuserId - 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.
TwitterException - when Twitter service or network is unavailable
public IDs getFriendsIDs(java.lang.String screenName)
throws TwitterException
getFriendsIDs in interface FriendsFollowersMethodsscreenName - Specifies the screen name of the user for whom to return the friends list.
TwitterException - when Twitter service or network is unavailable
public IDs getFriendsIDs(java.lang.String screenName,
long cursor)
throws TwitterException
getFriendsIDs in interface FriendsFollowersMethodsscreenName - 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.
TwitterException - when Twitter service or network is unavailable
public IDs getFollowersIDs()
throws TwitterException
getFollowersIDs in interface FriendsFollowersMethodsTwitterException - when Twitter service or network is unavailable
public IDs getFollowersIDs(long cursor)
throws TwitterException
getFollowersIDs in interface FriendsFollowersMethodscursor - 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.
TwitterException - when Twitter service or network is unavailable
public IDs getFollowersIDs(int userId)
throws TwitterException
getFollowersIDs in interface FriendsFollowersMethodsuserId - Specifies the ID of the user for whom to return the followers list.
TwitterException - when Twitter service or network is unavailable
public IDs getFollowersIDs(int userId,
long cursor)
throws TwitterException
getFollowersIDs in interface FriendsFollowersMethodsuserId - 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.
TwitterException - when Twitter service or network is unavailable
public IDs getFollowersIDs(java.lang.String screenName)
throws TwitterException
getFollowersIDs in interface FriendsFollowersMethodsscreenName - Specifies the screen name of the user for whom to return the followers list.
TwitterException - when Twitter service or network is unavailable
public IDs getFollowersIDs(java.lang.String screenName,
long cursor)
throws TwitterException
getFollowersIDs in interface FriendsFollowersMethodsscreenName - 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.
TwitterException - when Twitter service or network is unavailable
public User verifyCredentials()
throws TwitterException
verifyCredentials in interface AccountMethodsTwitterException - when Twitter service or network is unavailable, or if supplied credential is wrong (TwitterException.getStatusCode() == 401)
public RateLimitStatus getRateLimitStatus()
throws TwitterException
getRateLimitStatus in interface AccountMethodsTwitterException - when Twitter service or network is unavailable
public User updateProfile(java.lang.String name,
java.lang.String email,
java.lang.String url,
java.lang.String location,
java.lang.String description)
throws TwitterException
updateProfile in interface AccountMethodsname - Optional. Maximum of 20 characters.email - Optional. Maximum of 40 characters. Must be a valid email address.url - Optional. Maximum of 100 characters. Will be prepended with "http://" if not present.location - Optional. Maximum of 30 characters. The contents are not normalized or geocoded in any way.description - Optional. Maximum of 160 characters.
TwitterException - when Twitter service or network is unavailable
public User updateProfile(java.lang.String name,
java.lang.String url,
java.lang.String location,
java.lang.String description)
throws TwitterException
updateProfile in interface AccountMethodsname - 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.
TwitterException - when Twitter service or network is unavailable
public AccountTotals getAccountTotals()
throws TwitterException
getAccountTotals in interface AccountMethodsTwitterException - when Twitter service or network is unavailable
public AccountSettings getAccountSettings()
throws TwitterException
getAccountSettings in interface AccountMethodsTwitterException - when Twitter service or network is unavailable
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
updateProfileColors in interface AccountMethodsprofileBackgroundColor - optional, can be nullprofileTextColor - optional, can be nullprofileLinkColor - optional, can be nullprofileSidebarFillColor - optional, can be nullprofileSidebarBorderColor - optional, can be null
TwitterException - when Twitter service or network is unavailable
public User updateProfileImage(java.io.File image)
throws TwitterException
updateProfileImage in interface AccountMethodsimage - 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.
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)
public User updateProfileBackgroundImage(java.io.File image,
boolean tile)
throws TwitterException
updateProfileBackgroundImage in interface AccountMethodsimage - 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.
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)
public ResponseList<Status> getFavorites()
throws TwitterException
getFavorites in interface FavoriteMethodsTwitterException - when Twitter service or network is unavailable
public ResponseList<Status> getFavorites(int page)
throws TwitterException
getFavorites in interface FavoriteMethodspage - the number of page
TwitterException - when Twitter service or network is unavailable
public ResponseList<Status> getFavorites(java.lang.String id)
throws TwitterException
getFavorites in interface FavoriteMethodsid - the ID or screen name of the user for whom to request a list of favorite statuses
TwitterException - when Twitter service or network is unavailable
public ResponseList<Status> getFavorites(java.lang.String id,
int page)
throws TwitterException
getFavorites in interface FavoriteMethodsid - the ID or screen name of the user for whom to request a list of favorite statusespage - the number of page
TwitterException - when Twitter service or network is unavailable
public Status createFavorite(long id)
throws TwitterException
createFavorite in interface FavoriteMethodsid - the ID of the status to favorite
TwitterException - when Twitter service or network is unavailable
public Status destroyFavorite(long id)
throws TwitterException
destroyFavorite in interface FavoriteMethodsid - the ID of the status to un-favorite
TwitterException - when Twitter service or network is unavailable
public User enableNotification(java.lang.String screenName)
throws TwitterException
enableNotification in interface NotificationMethodsscreenName - Specifies the screen name of the user to follow with device updates.
TwitterException - when Twitter service or network is unavailable
public User enableNotification(int userId)
throws TwitterException
enableNotification in interface NotificationMethodsuserId - Specifies the ID of the user to follow with device updates.
TwitterException - when Twitter service or network is unavailable
public User disableNotification(java.lang.String screenName)
throws TwitterException
disableNotification in interface NotificationMethodsscreenName - Specifies the screen name of the user to disable device notifications.
TwitterException - when Twitter service or network is unavailable
public User disableNotification(int userId)
throws TwitterException
disableNotification in interface NotificationMethodsuserId - Specifies the ID of the user to disable device notifications.
TwitterException - when Twitter service or network is unavailable
public User createBlock(java.lang.String screenName)
throws TwitterException
createBlock in interface BlockMethodsscreenName - the screen_name of the user to block
TwitterException - when Twitter service or network is unavailable
public User createBlock(int userId)
throws TwitterException
createBlock in interface BlockMethodsuserId - the ID of the user to block
TwitterException - when Twitter service or network is unavailable
public User destroyBlock(java.lang.String screen_name)
throws TwitterException
destroyBlock in interface BlockMethodsscreen_name - the screen_name of the user to block
TwitterException - when Twitter service or network is unavailable
public User destroyBlock(int userId)
throws TwitterException
destroyBlock in interface BlockMethodsuserId - the ID of the user to block
TwitterException - when Twitter service or network is unavailable
public boolean existsBlock(java.lang.String screenName)
throws TwitterException
existsBlock in interface BlockMethodsscreenName - The screen_name of the potentially blocked user.
TwitterException - when Twitter service or network is unavailable
public boolean existsBlock(int userId)
throws TwitterException
existsBlock in interface BlockMethodsuserId - The ID of the potentially blocked user.
TwitterException - when Twitter service or network is unavailable
public ResponseList<User> getBlockingUsers()
throws TwitterException
getBlockingUsers in interface BlockMethodsTwitterException - when Twitter service or network is unavailable
public ResponseList<User> getBlockingUsers(int page)
throws TwitterException
getBlockingUsers in interface BlockMethodspage - the number of page
TwitterException - when Twitter service or network is unavailable
public IDs getBlockingUsersIDs()
throws TwitterException
getBlockingUsersIDs in interface BlockMethodsTwitterException - when Twitter service or network is unavailable
public User reportSpam(int userId)
throws TwitterException
reportSpam in interface SpamReportingMethodsuserId - The ID of the user you want to report as a spammer.
TwitterException - when Twitter service or network is unavailable
public User reportSpam(java.lang.String screenName)
throws TwitterException
reportSpam in interface SpamReportingMethodsscreenName - The screen name of the user you want to report as a spammer.
TwitterException - when Twitter service or network is unavailable
public java.util.List<SavedSearch> getSavedSearches()
throws TwitterException
getSavedSearches in interface SavedSearchesMethodsTwitterException - when Twitter service or network is unavailable
public SavedSearch showSavedSearch(int id)
throws TwitterException
showSavedSearch in interface SavedSearchesMethodsid - The id of the saved search to be retrieved.
TwitterException - when Twitter service or network is unavailable
public SavedSearch createSavedSearch(java.lang.String query)
throws TwitterException
createSavedSearch in interface SavedSearchesMethodsquery - the query string
TwitterException - when Twitter service or network is unavailable
public SavedSearch destroySavedSearch(int id)
throws TwitterException
destroySavedSearch in interface SavedSearchesMethodsid - The id of the saved search to be deleted.
TwitterException - when Twitter service or network is unavailable
public ResponseList<Location> getAvailableTrends()
throws TwitterException
getAvailableTrends in interface LocalTrendsMethodsTwitterException - when Twitter service or network is unavailable
public ResponseList<Location> getAvailableTrends(GeoLocation location)
throws TwitterException
getAvailableTrends in interface LocalTrendsMethodslocation - the available trend locations will be sorted by distance to the lat and long passed in. The sort is nearest to furthest.
TwitterException - when Twitter service or network is unavailable
public Trends getLocationTrends(int woeid)
throws TwitterException
getLocationTrends in interface LocalTrendsMethodswoeid - The WOEID of the location to be querying for
TwitterException - when Twitter service or network is unavailable
public ResponseList<Place> searchPlaces(GeoQuery query)
throws TwitterException
searchPlaces in interface GeoMethodsquery - search query
TwitterException - when Twitter service or network is unavailable
public SimilarPlaces getSimilarPlaces(GeoLocation location,
java.lang.String name,
java.lang.String containedWithin,
java.lang.String streetAddress)
throws TwitterException
getSimilarPlaces in interface GeoMethodslocation - 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.
TwitterException - when Twitter service or network is unavailable
public ResponseList<Place> getNearbyPlaces(GeoQuery query)
throws TwitterException
getNearbyPlaces in interface GeoMethodsquery - search query
TwitterException - when Twitter service or network is unavailable
public ResponseList<Place> reverseGeoCode(GeoQuery query)
throws TwitterException
reverseGeoCode in interface GeoMethodsquery - search query
TwitterException - when Twitter service or network is unavailable
public Place getGeoDetails(java.lang.String id)
throws TwitterException
GeoMethodsAsync.reverseGeoCode(twitter4j.GeoQuery) method.
getGeoDetails in interface GeoMethodsid - The ID of the location to query about.
TwitterException - when Twitter service or network is unavailable
public Place createPlace(java.lang.String name,
java.lang.String containedWithin,
java.lang.String token,
GeoLocation location,
java.lang.String streetAddress)
throws TwitterException
createPlace in interface GeoMethodsname - 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.
TwitterException - when Twitter service or network is unavailable
public java.lang.String getTermsOfService()
throws TwitterException
getTermsOfService in interface LegalResourcesTwitterException - when Twitter service or network is unavailable
public java.lang.String getPrivacyPolicy()
throws TwitterException
getPrivacyPolicy in interface LegalResourcesTwitterException - when Twitter service or network is unavailable
public RelatedResults getRelatedResults(long statusId)
throws TwitterException
getRelatedResults in interface NewTwitterMethodsstatusId - the numerical ID of the status you're trying to retrieve
TwitterException - when Twitter service or network is unavailable
public boolean test()
throws TwitterException
test in interface HelpMethodsTwitterException - when Twitter service or network is unavailablepublic java.lang.String toString()
public RequestToken getOAuthRequestToken()
throws TwitterException
getOAuthRequestToken in interface OAuthSupportTwitterException - when Twitter service or network is unavailable
public RequestToken getOAuthRequestToken(java.lang.String callbackUrl)
throws TwitterException
getOAuthRequestToken in interface OAuthSupportcallbackUrl - callback URL
TwitterException - when Twitter service or network is unavailable
public AccessToken getOAuthAccessToken()
throws TwitterException
getOAuthAccessToken in interface OAuthSupportTwitterException - When Twitter service or network is unavailable, when the user has not authorized, or when the client application is not permitted to use xAuth
public AccessToken getOAuthAccessToken(java.lang.String oauthVerifier)
throws TwitterException
getOAuthAccessToken in interface OAuthSupportoauthVerifier - OAuth verifier. AKA pin.
java.lang.IllegalStateException - when AccessToken has already been retrieved or set
TwitterException - when Twitter service or network is unavailable, or the user has not authorized
public AccessToken getOAuthAccessToken(RequestToken requestToken)
throws TwitterException
getOAuthAccessToken in interface OAuthSupportrequestToken - the request token
java.lang.IllegalStateException - when AccessToken has already been retrieved or set
TwitterException - when Twitter service or network is unavailable, or the user has not authorized
public AccessToken getOAuthAccessToken(RequestToken requestToken,
java.lang.String oauthVerifier)
throws TwitterException
getOAuthAccessToken in interface OAuthSupportrequestToken - the request tokenoauthVerifier - OAuth verifier. AKA pin.
java.lang.IllegalStateException - when AccessToken has already been retrieved or set
TwitterException - when Twitter service or network is unavailable, or the user has not authorizedpublic void setOAuthAccessToken(AccessToken accessToken)
setOAuthAccessToken in interface OAuthSupportaccessToken - accessToken
public AccessToken getOAuthAccessToken(java.lang.String token,
java.lang.String tokenSecret)
throws TwitterException
getOAuthAccessToken in interface OAuthSupporttoken - the screen nametokenSecret - the password
TwitterException - when Twitter service or network is unavailable, or the user has not authorized
public AccessToken getOAuthAccessToken(java.lang.String token,
java.lang.String tokenSecret,
java.lang.String pin)
throws TwitterException
token - request tokentokenSecret - request token secretpin - pin
TwitterException - when Twitter service or network is unavailable, or the user has not authorized
public void setOAuthAccessToken(java.lang.String token,
java.lang.String tokenSecret)
TwitterFactory.getInstance(twitter4j.http.Authorization) instead
token - access tokentokenSecret - access token secret
java.lang.IllegalStateException - when AccessToken has already been retrieved or setpublic boolean isOAuthEnabled()
public void setOAuthConsumer(java.lang.String consumerKey,
java.lang.String consumerSecret)
consumerKey - OAuth consumer keyconsumerSecret - OAuth consumer secretpublic void shutdown()
public void setRateLimitStatusListener(RateLimitStatusListener listener)
listener - the listener to be addedpublic boolean equals(java.lang.Object o)
public int hashCode()
public void httpResponseReceived(twitter4j.internal.http.HttpResponseEvent event)
httpResponseReceived in interface twitter4j.internal.http.HttpResponseListenerpublic final boolean isBasicAuthEnabled()
public final Authorization getAuthorization()
public Configuration getConfiguration()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||