Method: Twitter::REST::Tweets#update!

Defined in:
lib/twitter/rest/tweets.rb

#update!(status, options = {}) ⇒ Twitter::Tweet

Note:

A status update with text identical to the authenticating user's current status will be ignored to prevent duplicates.

Updates the authenticating user's status

Parameters:

  • status (String)

    The text of your status update, up to 280 characters.

  • options (Hash) (defaults to: {})

    A customizable set of options.

Options Hash (options):

  • :possibly_sensitive (Boolean, String, Integer)

    Set to true for content which may not be suitable for every audience.

  • :in_reply_to_status (Twitter::Tweet)

    An existing status that the update is in reply to. If the status being replied to was not originally posted by the authenticated user, the text of the status must begin with an @-mention, or twitter will reject the update.

  • :in_reply_to_status_id (Integer)

    The ID of an existing status that the update is in reply to.

  • :lat (Float)

    The latitude of the location this tweet refers to. This option will be ignored unless it is inside the range -90.0 to +90.0 (North is positive) inclusive. It will also be ignored if there isn't a corresponding :long option.

  • :long (Float)

    The longitude of the location this tweet refers to. The valid ranges for longitude is -180.0 to +180.0 (East is positive) inclusive. This option will be ignored if outside that range, if it is not a number, if geo_enabled is disabled, or if there not a corresponding :lat option.

  • :place (Twitter::Place)

    A place in the world. These can be retrieved from PlacesAndGeo#reverse_geocode.

  • :place_id (String)

    A place in the world. These IDs can be retrieved from PlacesAndGeo#reverse_geocode.

  • :display_coordinates (String)

    Whether or not to put a pin on the exact coordinates a tweet has been sent from.

  • :trim_user (Boolean, String, Integer)

    Each tweet returned in a timeline will include a user object with only the author's numerical ID when set to true, 't' or 1.

Returns:

Raises:

See Also:

Rate Limited?:

  • No

Authentication:

  • Requires user context



153
154
155
156
157
158
# File 'lib/twitter/rest/tweets.rb', line 153

def update!(status, options = {})
  hash = options.dup
  hash[:in_reply_to_status_id] = hash.delete(:in_reply_to_status).id unless hash[:in_reply_to_status].nil?
  hash[:place_id] = hash.delete(:place).woeid unless hash[:place].nil?
  perform_post_with_object("/1.1/statuses/update.json", hash.merge(status: status), Twitter::Tweet)
end