Java twitter4j Twitter fields, constructors, methods, implement or subclass

Example usage for Java twitter4j Twitter fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for twitter4j Twitter.

The text is from its open source code.

Subclass

twitter4j.Twitter has subclasses.
Click this link to see all its subclasses.

Implementation

twitter4j.Twitter has the following implementations.
Click this link to see all its implementation.

Constructor

Method

UsercreateBlock(long userId)
Blocks the user specified in the ID parameter as the authenticating user.
StatuscreateFavorite(long id)
Favorites the status specified in the ID parameter as the authenticating user.
UsercreateFriendship(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.
UsercreateFriendship(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.
UsercreateMute(long userId)
Mutes the user specified in the ID parameter as the authenticating user.
SavedSearchcreateSavedSearch(String query)
Creates a saved search for the authenticated user.
UserListcreateUserList(String listName, boolean isPublicList, String description)
Creates a new list for the authenticated user.
UserListcreateUserListMember(long listId, long userId)
Adds a member to a list.
UserListcreateUserListMembers(long listId, long... userIds)
Adds multiple members to a list, by specifying a comma-separated list of member ids or screen names.
UserListcreateUserListSubscription(long listId)
Make the authenticated user follow the specified list.
UserdestroyBlock(long userId)
Un-blocks the user specified in the ID parameter as the authenticating user.
voiddestroyDirectMessage(long id)
Deletes the direct message specified in the required ID parameter.
StatusdestroyFavorite(long id)
Un-favorites the status specified in the ID parameter as the authenticating user.
UserdestroyFriendship(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.
UserdestroyMute(long userId)
Un-mutes the user specified in the ID parameter as the authenticating user.
SavedSearchdestroySavedSearch(long id)
Destroys a saved search for the authenticated user.
StatusdestroyStatus(long statusId)
Destroys the status specified by the required ID parameter.
Usage note: The authenticating user must be the author of the specified status.
UserListdestroyUserList(long listId)
Deletes the specified list.
UserListdestroyUserListMember(long listId, long userId)
Removes the specified member from the list.
UserListdestroyUserListSubscription(long listId)
Unsubscribes the authenticated user form the specified list.
AccountSettingsgetAccountSettings()
Returns the current trend, geo, language, timezone and sleep time information for the authenticating user.
ResponseListgetAvailableTrends()
Returns the locations that Twitter has trending topic information for.
IDsgetBlocksIDs()
Returns an array of numeric user ids the authenticating user is blocking.
PagableResponseListgetBlocksList(long cursor)
Returns a list of user objects that the authenticating user is blocking.
ResponseListgetClosestTrends(GeoLocation location)
Returns the locations that Twitter has trending topic information for, closest to a specified location.
The response is an array of "locations" that encode the location's WOEID and some other human-readable information such as a canonical name and country the location belongs in.
A WOEID is a Yahoo!
DirectMessageListgetDirectMessages(int count)
Returns all Direct Message events (both sent and received) within the last 30 days.
ResponseListgetFavorites(long userId)
Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.
ResponseListgetFavorites(long userId, Paging paging)
Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.
ResponseListgetFavorites()
Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format.
IDsgetFollowersIDs(long userId, long cursor)
Returns an array of numeric IDs for every user the specified user is followed by.
IDsgetFollowersIDs(long cursor)
Returns an array of numeric IDs for every user the specified user is followed by.
IDsgetFollowersIDs(long userId, long cursor, int count)
Returns an array of numeric IDs for every user the specified user is followed by.
PagableResponseListgetFollowersList(long userId, long cursor)
Returns a cursored collection of user objects for users following the specified user.
At this time, results are ordered with the most recent following first — however, this ordering is subject to unannounced change and eventual consistency issues.
PagableResponseListgetFollowersList(long userId, long cursor, int count)
Returns a cursored collection of user objects for users following the specified user.
At this time, results are ordered with the most recent following first — however, this ordering is subject to unannounced change and eventual consistency issues.
IDsgetFriendsIDs(long cursor)
Returns an array of numeric IDs for every user the authenticating user is following.
IDsgetFriendsIDs(long userId, long cursor)
Returns an array of numeric IDs for every user the specified user is following.
PagableResponseListgetFriendsList(long userId, long cursor, int count)
Returns a cursored collection of user objects for every user the specified user is following (otherwise known as their "friends").
At this time, results are ordered with the most recent following first — however, this ordering is subject to unannounced change and eventual consistency issues.
PagableResponseListgetFriendsList(long userId, long cursor)
Returns a cursored collection of user objects for every user the specified user is following (otherwise known as their "friends").
At this time, results are ordered with the most recent following first — however, this ordering is subject to unannounced change and eventual consistency issues.
PlacegetGeoDetails(String placeId)
Find out more details of a place that was returned from the PlacesGeoResources#reverseGeoCode(twitter4j.GeoQuery) method.
ResponseListgetHomeTimeline()
Returns the 20 most recent statuses, including retweets, posted by the authenticating user and that user's friends.
ResponseListgetHomeTimeline(Paging paging)
Returns the 20 most recent statuses, including retweets, posted by the authenticating user and that user's friends.
IDsgetIncomingFriendships(long cursor)
Returns an array of numeric IDs for every user who has a pending request to follow the authenticating user.
ResponseListgetMemberSuggestions(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.
ResponseListgetMentionsTimeline(Paging paging)
Returns the 20 most recent mentions (tweets containing a users's @screen_name) for the authenticating user.
The timeline returned is the equivalent of the one seen when you view your mentions on twitter.com.
This method can only return up to 800 tweets.
See Working with Timelines for instructions on traversing timelines.
ResponseListgetMentionsTimeline()
Returns the 20 most recent mentions (tweets containing a users's @screen_name) for the authenticating user.
The timeline returned is the equivalent of the one seen when you view your mentions on twitter.com.
This method can only return up to 800 tweets.
See Working with Timelines for instructions on traversing timelines.
IDsgetMutesIDs(long cursor)
Returns an array of numeric user ids the authenticating user is muting.
OAuth2TokengetOAuth2Token()
Obtains an OAuth 2 Bearer token.
AccessTokengetOAuthAccessToken(RequestToken requestToken, String oauthVerifier)
Retrieves an access token associated with the supplied request token and sets userId.
AccessTokengetOAuthAccessToken(String oauthVerifier)
Retrieves an access token.
AccessTokengetOAuthAccessToken()
Returns an access token associated with this instance.
If no access token is associated with this instance, this will retrieve a new access token.
RequestTokengetOAuthRequestToken()
Retrieves a request token
RequestTokengetOAuthRequestToken(String callbackURL)
Retrieves a request token
IDsgetOutgoingFriendships(long cursor)
Returns an array of numeric IDs for every protected user for whom the authenticating user has a pending follow request.
TrendsgetPlaceTrends(int woeid)
Returns the top 10 trending topics for a specific WOEID, if trending information is available for it.
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 Twitter Search, and the Twitter Search URL.
This information is cached for 5 minutes.
StringgetPrivacyPolicy()
Returns Twitter's Privacy Policy.
MapgetRateLimitStatus()
Returns the current rate limits for methods belonging to the specified resource families.
Each 1.1 API resource belongs to a "resource family" which is indicated in its method documentation.
MapgetRateLimitStatus(String... resources)
Returns the current rate limits for methods belonging to the specified resource families.
Each 1.1 API resource belongs to a "resource family" which is indicated in its method documentation.
ResponseListgetRetweets(long statusId)
Returns up to 100 of the first retweets of a given tweet.
ResponseListgetRetweetsOfMe(Paging paging)
Returns the 20 most recent tweets of the authenticated user that have been retweeted by others.
ResponseListgetRetweetsOfMe()
Returns the 20 most recent tweets of the authenticated user that have been retweeted by others.
ResponseListgetSavedSearches()
Returns the authenticated user's saved search queries.
ResponseListgetSimilarPlaces(GeoLocation location, String name, String containedWithin, String streetAddress)
Locates places near the given coordinates which are similar in name.
ResponseListgetSuggestedUserCategories()
Access to Twitter's suggested user list.
StringgetTermsOfService()
Returns Twitter's' Terms of Service.
PagableResponseListgetUserListMembers(long listId, long cursor)
Returns the members of the specified list.
PagableResponseListgetUserListMembers(long listId, int count, long cursor)
Returns the members of the specified list.
PagableResponseListgetUserListMemberships(int count, long cursor)
List the lists the authenticating user has been added to.
ResponseListgetUserLists(String listOwnerScreenName, boolean reverse)
List the lists of the specified user.
ResponseListgetUserLists(String listOwnerScreenName)
List the lists of the specified user.
ResponseListgetUserListStatuses(long listId, Paging paging)
Show tweet timeline for members of the specified list.
PagableResponseListgetUserListSubscribers(long listId, long cursor)
Returns the subscribers of the specified list.
PagableResponseListgetUserListSubscriptions(String listSubscriberScreenName, long cursor)
List the lists the specified user follows.
ResponseListgetUserSuggestions(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.
ResponseListgetUserTimeline()
Returns the 20 most recent statuses posted from the authenticating user.
ResponseListgetUserTimeline(String screenName)
Returns the 20 most recent statuses posted from the authenticating user.
ResponseListgetUserTimeline(String screenName, Paging paging)
Returns the 20 most recent statuses posted from the authenticating user.
ResponseListlookupFriendships(long... ids)
Returns the relationship of the authenticating user to the specified users.
ResponseListlookupUsers(long... ids)
Return up to 100 users worth of extended information, specified by either ID, screen name, or combination of the two.
UserreportSpam(long userId)
The user specified in the id is blocked by the authenticated user and reported as a spammer.
StatusretweetStatus(long statusId)
Retweets a tweet.
ResponseListreverseGeoCode(GeoQuery query)
Search for places (cities and neighborhoods) that can be attached to a statuses/update.
SavedSearchesResourcessavedSearches()
QueryResultsearch(Query query)
Returns tweets that match a specified query.
ResponseListsearchPlaces(GeoQuery query)
Search for places that can be attached to a statuses/update.
ResponseListsearchUsers(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.
DirectMessagesendDirectMessage(long userId, String text)
Sends a new direct message to the specified user from the authenticating user.
DirectMessagesendDirectMessage(long userId, String text, QuickReply... quickReplies)
Sends a new direct message to the specified user from the authenticating user.
voidsetOAuthAccessToken(AccessToken accessToken)
Sets the access token
voidsetOAuthConsumer(String consumerKey, String consumerSecret)
sets the OAuth consumer key and consumer secret
DirectMessageshowDirectMessage(long id)
Returns a single Direct Message event by the given id.
RelationshipshowFriendship(long sourceId, long targetId)
Returns detailed information about the relationship between two users.
SavedSearchshowSavedSearch(long id)
Retrieve the data for a saved search owned by the authenticating user specified by the given id.
StatusshowStatus(long id)
Returns a single status, specified by the id parameter below.
UsershowUser(long userId)
Returns extended information of a given user, specified by ID or screen name as per the required id parameter.
UserListshowUserList(long listId)
Show the specified list.
UsershowUserListMembership(long listId, long userId)
Check if a user is a member of the specified list.

This method calls https://api.twitter.com/1.1/lists/members/show.json
UsershowUserListSubscription(long listId, long userId)
Check if the specified user is a subscriber of the specified list.
TimelinesResourcestimelines()
RelationshipupdateFriendship(long userId, boolean enableDeviceNotification, boolean retweets)
Allows you to enable or disable retweets and device notifications from the specified user.
UserupdateProfile(String name, String url, String location, String description)
Sets values that users are able to set under the "Account" tab of their settings page.
UserupdateProfileImage(File image)
Updates the authenticating user's profile image.
StatusupdateStatus(String status)
Updates the authenticating user's status.
UserListupdateUserList(long listId, String newListName, boolean isPublicList, String newDescription)
Updates the specified list.
UploadedMediauploadMedia(File mediaFile)
Uploads media image to be attached via #updateStatus(twitter4j.StatusUpdate)
This method calls https://api.twitter.com/1.1/media/upload.json
UploadedMediauploadMedia(String fileName, InputStream media)
Uploads media image to be attached via #updateStatus(twitter4j.StatusUpdate)
This method calls https://api.twitter.com/1.1/media/upload.json
UsersResourcesusers()
UserverifyCredentials()
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.