Package twitter4j.v1

Interface TweetsResources


public interface TweetsResources
  • Method Details

    • getRetweets

      ResponseList<Status> getRetweets(long statusId) throws TwitterException
      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

      IDs getRetweeterIds(long statusId, long cursor) throws TwitterException
      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

      IDs getRetweeterIds(long statusId, int count, long cursor) throws TwitterException
      Returns a collection of up to count 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

      Status showStatus(long id) throws TwitterException
      Returns a single status, specified by the id parameter below. The status's author will be returned inline.
      This method calls 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

      Status destroyStatus(long statusId) throws TwitterException
      Destroys the status specified by the required ID parameter.
      Usage note: The authenticating user must be the author of the specified status.
      This method calls 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

      Status updateStatus(String status) throws TwitterException
      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

      Status updateStatus(StatusUpdate latestStatus) throws TwitterException
      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

      Status retweetStatus(long statusId) throws TwitterException
      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

      Status unRetweetStatus(long statusId) throws TwitterException
      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

      OEmbed getOEmbed(OEmbedRequest req) throws TwitterException
      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

      ResponseList<Status> lookup(long... ids) throws TwitterException
      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

      UploadedMedia uploadMedia(File mediaFile) throws TwitterException
      Uploads media image to be attached via updateStatus(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

      UploadedMedia uploadMedia(String fileName, InputStream media) throws TwitterException
      Uploads media image to be attached via updateStatus(StatusUpdate)
      This method calls https://api.twitter.com/1.1/media/upload.json
      Parameters:
      fileName - media file name
      media - media body as stream
      Returns:
      upload result
      Throws:
      TwitterException - when Twitter service or network is unavailable
      Since:
      Twitter4J 4.0.3
      See Also:
    • uploadMediaChunked

      UploadedMedia uploadMediaChunked(String fileName, InputStream media) throws TwitterException
      Uploads media using chunked approach to be attached via updateStatus(StatusUpdate). This should be used for videos.
      This method calls https://api.twitter.com/1.1/media/upload.json
      Parameters:
      fileName - media file name
      media - media body as stream
      Returns:
      upload result
      Throws:
      TwitterException - when Twitter service or network is unavailable
      Since:
      Twitter4J 4.0.7
      See Also: