Package twitter4j.v1
Interface TweetsResources
public interface TweetsResources
-
Method Summary
Modifier and TypeMethodDescriptiondestroyStatus
(long statusId) Destroys the status specified by the required ID parameter.
Usage note: The authenticating user must be the author of the specified status.getOEmbed
(OEmbedRequest req) Returns information allowing the creation of an embedded representation of a Tweet on third party sites.getRetweeterIds
(long statusId, int count, long cursor) Returns a collection of up tocount
user IDs belonging to users who have retweeted the tweet specified by the id parameter.getRetweeterIds
(long statusId, long cursor) Returns a collection of up to 100 user IDs belonging to users who have retweeted the tweet specified by the id parameter.getRetweets
(long statusId) Returns up to 100 of the first retweets of a given tweet.lookup
(long... ids) Returns fully-hydrated tweet objects for up to 100 tweets per request, as specified by comma-separated values passed to the id parameter.retweetStatus
(long statusId) Retweets a tweet.showStatus
(long id) Returns a single status, specified by the id parameter below.unRetweetStatus
(long statusId) Untweets a retweeted status.updateStatus
(String status) Updates the authenticating user's status.updateStatus
(StatusUpdate latestStatus) Updates the authenticating user's status.uploadMedia
(File mediaFile) Uploads media image to be attached viaupdateStatus(StatusUpdate)
This method calls https://api.twitter.com/1.1/media/upload.jsonuploadMedia
(String fileName, InputStream media) Uploads media image to be attached viaupdateStatus(StatusUpdate)
This method calls https://api.twitter.com/1.1/media/upload.jsonuploadMediaChunked
(String fileName, InputStream media) Uploads media using chunked approach to be attached viaupdateStatus(StatusUpdate)
.
-
Method Details
-
getRetweets
Returns up to 100 of the first retweets of a given tweet.
This method calls https://api.twitter.com/1.1/statuses/retweets- Parameters:
statusId
- The numerical ID of the tweet you want the retweets of.- Returns:
- the retweets of a given tweet
- Throws:
TwitterException
- when Twitter service or network is unavailable- Since:
- Twitter4J 2.0.10
- See Also:
-
getRetweeterIds
Returns a collection of up to 100 user IDs belonging to users who have retweeted the tweet specified by the id parameter.
This method calls https://api.twitter.com/1.1/get/statuses/retweeters/ids- Parameters:
statusId
- The numerical ID of the tweet you want the retweeters of.cursor
- The cursor of the page to fetch. Use -1 to start.- Returns:
- the retweets of a given tweet
- Throws:
TwitterException
- when Twitter service or network is unavailable- Since:
- Twitter4J 3.0.5
- See Also:
-
getRetweeterIds
Returns a collection of up tocount
user IDs belonging to users who have retweeted the tweet specified by the id parameter.
This method calls https://api.twitter.com/1.1/get/statuses/retweeters/ids- Parameters:
statusId
- The numerical ID of the tweet you want the retweeters of.count
- The maximum number of retweeter IDs to retrieve. Must be between 1 and 200, inclusive.cursor
- The cursor of the page to fetch. Use -1 to start.- Returns:
- the retweets of a given tweet
- Throws:
TwitterException
- when Twitter service or network is unavailable- Since:
- Twitter4J 3.0.5
- See Also:
-
showStatus
Returns a single status, specified by the id parameter below. The status's author will be returned inline.
This method calls https://api.twitter.com/1.1/statuses/show- Parameters:
id
- the numerical ID of the status you're trying to retrieve- Returns:
- a single status
- Throws:
TwitterException
- when Twitter service or network is unavailable- Since:
- Twitter4J 2.0.1
- See Also:
-
destroyStatus
Destroys the status specified by the required ID parameter.
Usage note: The authenticating user must be the author of the specified status.
This method calls https://api.twitter.com/1.1/statuses/destroy- Parameters:
statusId
- The ID of the status to destroy.- Returns:
- the deleted status
- Throws:
TwitterException
- when Twitter service or network is unavailable- Since:
- 1.0.5
- See Also:
-
updateStatus
Updates the authenticating user's status. A status update with text identical to the authenticating user's current status will be ignored to prevent duplicates.
This method calls https://api.twitter.com/1.1/statuses/update- Parameters:
status
- the text of your status update- Returns:
- the latest status
- Throws:
TwitterException
- when Twitter service or network is unavailable- Since:
- Twitter4J 2.0.1
- See Also:
-
updateStatus
Updates the authenticating user's status. A status update with text identical to the authenticating user's current status will be ignored to prevent duplicates.
This method calls https://api.twitter.com/1.1/statuses/update or
This method calls https://upload.twitter.com/1/statuses/update_with_media- Parameters:
latestStatus
- the latest status to be updated.- Returns:
- the latest status
- Throws:
TwitterException
- when Twitter service or network is unavailable- Since:
- Twitter4J 2.1.1
- See Also:
-
retweetStatus
Retweets a tweet. Returns the original tweet with retweet details embedded.
This method calls https://api.twitter.com/1.1/statuses/retweet- Parameters:
statusId
- The ID of the status to retweet.- Returns:
- the retweeted status
- Throws:
TwitterException
- when Twitter service or network is unavailable- Since:
- Twitter4J 2.0.10
- See Also:
-
unRetweetStatus
Untweets a retweeted status. Returns the original Tweet with retweet details embedded.
This method calls https://api.twitter.com/1.1/statuses/unretweet- Parameters:
statusId
- The ID of the status to un-retweet.- Returns:
- the original Tweet with retweet details embedded
- Throws:
TwitterException
- when Twitter service or network is unavailable- Since:
- Twitter4J 4.0.7
- See Also:
-
getOEmbed
Returns information allowing the creation of an embedded representation of a Tweet on third party sites. See the oEmbed specification for information about the response format. While this endpoint allows a bit of customization for the final appearance of the embedded Tweet, be aware that the appearance of the rendered Tweet may change over time to be consistent with Twitter's Display Requirements. Do not rely on any class or id parameters to stay constant in the returned markup.
This method calls https://api.twitter.com/1.1/statuses/oembed.json- Parameters:
req
- request- Returns:
- information allowing the creation of an embedded representation of a Tweet on third party sites
- Throws:
TwitterException
- when Twitter service or network is unavailable- Since:
- Twitter4J 3.0.2
- See Also:
-
lookup
Returns fully-hydrated tweet objects for up to 100 tweets per request, as specified by comma-separated values passed to the id parameter. This method is especially useful to get the details (hydrate) a collection of Tweet IDs.
This method calls https://api.twitter.com/1.1/statuses/lookup.json- Parameters:
ids
- array of the ids to lookup- Returns:
- list of the tweets
- Throws:
TwitterException
- when Twitter service or network is unavailable- Since:
- Twitter4J 4.0.2
- See Also:
-
uploadMedia
Uploads media image to be attached viaupdateStatus(StatusUpdate)
This method calls https://api.twitter.com/1.1/media/upload.json- Parameters:
mediaFile
- the latest status to be updated.- Returns:
- upload result
- Throws:
TwitterException
- when Twitter service or network is unavailable- Since:
- Twitter4J 4.0.2
- See Also:
-
uploadMedia
Uploads media image to be attached viaupdateStatus(StatusUpdate)
This method calls https://api.twitter.com/1.1/media/upload.json- Parameters:
fileName
- media file namemedia
- media body as stream- Returns:
- upload result
- Throws:
TwitterException
- when Twitter service or network is unavailable- Since:
- Twitter4J 4.0.3
- See Also:
-
uploadMediaChunked
Uploads media using chunked approach to be attached viaupdateStatus(StatusUpdate)
. This should be used for videos.
This method calls https://api.twitter.com/1.1/media/upload.json- Parameters:
fileName
- media file namemedia
- media body as stream- Returns:
- upload result
- Throws:
TwitterException
- when Twitter service or network is unavailable- Since:
- Twitter4J 4.0.7
- See Also:
-