Module | Twitter::API |
In: |
lib/twitter/api.rb
|
DEFAULT_CURSOR | = | -1 |
MAX_USERS_PER_REQUEST | = | 100 |
METHOD_RATE_LIMITED | = | { :accept => false, :activity_about_me => true, :activity_by_friends => true, :block => true, :block? => true, :blocked_ids => true, :blocking => true, :configuration => true, :contributees => true, :contributors => true, :current_user => true, :d => false, :deny => false, :direct_message => true, :direct_message_create => false, :direct_message_destroy => false, :direct_messages => true, :direct_messages_received => true, :direct_messages_sent => true, :disable_notifications => false, :enable_notifications => false, :end_session => false, :fav => false, :fave => false, :favorite => false, :favorite_create => false, :favorite_destroy => false, :favorites => true, :follow => false, :follow! => false, :follower_ids => true, :following_followers_of => true, :friend_ids => true, :friendship => true, :friendship? => true, :friendship_create => false, :friendship_create! => false, :friendship_destroy => false, :friendship_show => true, :friendship_update => false, :friendships => true, :friendships_incoming => true, :friendships_outgoing => true, :geo_search => true, :home_timeline => true, :initialize => false, :languages => true, :list => true, :list_add_member => false, :list_add_members => false, :list_create => false, :list_destroy => false, :list_member? => true, :list_members => true, :list_remove_member => false, :list_remove_members => false, :list_subscribe => false, :list_subscriber? => true, :list_subscribers => true, :list_timeline => true, :list_unsubscribe => false, :list_update => false, :lists => true, :lists_subscribed_to => true, :local_trends => true, :m => false, :media_timeline => true, :memberships => true, :mentions => true, :network_timeline => true, :no_retweet_ids => true, :oembed => true, :oembeds => true, :phoenix_search => true, :place => true, :place_create => true, :places_nearby => true, :places_similar => true, :privacy => true, :rate_limit_status => false, :rate_limited? => false, :related_results => true, :related_statuses => true, :related_tweets => true, :recommendations => true, :relationship => true, :report_spam => true, :retweet => true, :retweeted_by => false, :retweeted_by_me => true, :retweeted_by_user => false, :retweeted_to => true, :retweeted_to_me => true, :retweeted_to_user => true, :retweeters_of => true, :retweets => true, :retweets_of_me => true, :reverse_geocode => true, :saved_search => true, :saved_search_create => false, :saved_search_destroy => false, :saved_searches => true, :search => true, :settings => true, :status => true, :status_activity => true, :status_destroy => false, :statuses => true, :statuses_activity => true, :subscriptions => true, :suggest_users => true, :suggestions => true, :tos => true, :trend_locations => true, :trends => true, :trends_daily => true, :trends_weekly => true, :tweet_activity => true, :tweet_destroy => false, :unblock => false, :unfavorite => false, :unfollow => false, :update => false, :update_delivery_device => false, :update_profile => false, :update_profile_background_image => false, :update_profile_colors => false, :update_profile_image => false, :update_with_media => false, :user => true, :user? => true, :user_search => true, :user_timeline => true, :users => true, :verify_credentials => true, } |
Allows the authenticating user to accept the specified users’ follow requests
@note Undocumented @rate_limited No @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::User>] The accepted users. @overload accept(*users)
@param users [Array<Integer, String, Twitter::User>, Set<Integer, String, Twitter::User>] An array of Twitter user IDs, screen names, or objects. @example Accept @sferik's follow request Twitter.accept('sferik')
@overload accept(*users, options)
@param users [Array<Integer, String, Twitter::User>, Set<Integer, String, Twitter::User>] An array of Twitter user IDs, screen names, or objects. @param options [Hash] A customizable set of options.
Returns activity about me
@note Undocumented @rate_limited Yes @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array] An array of actions @param options [Hash] A customizable set of options. @option options [Integer] :count Specifies the number of records to retrieve. Must be less than or equal to 100. @option options [Integer] :since_id Returns results with an ID greater than (that is, more recent than) the specified ID. @example Return activity about me
Twitter.activity_about_me
Returns activity by friends
@note Undocumented @rate_limited Yes @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid./ @return [Array] An array of actions @param options [Hash] A customizable set of options. @option options [Integer] :count Specifies the number of records to retrieve. Must be less than or equal to 100. @option options [Integer] :since_id Returns results with an ID greater than (that is, more recent than) the specified ID. @example Return activity by friends
Twitter.activity_by_friends
Blocks the users specified by the authenticating user
@see dev.twitter.com/docs/api/1/post/blocks/create @note Destroys a friendship to the blocked user if it exists. @rate_limited Yes @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::User>] The blocked users. @overload block(*users)
@param users [Array<Integer, String, Twitter::User>, Set<Integer, String, Twitter::User>] An array of Twitter user IDs, screen names, or objects. @example Block and unfriend @sferik as the authenticating user Twitter.block('sferik') Twitter.block(7505382) # Same as above
@overload block(*users, options)
@param users [Array<Integer, String, Twitter::User>, Set<Integer, String, Twitter::User>] An array of Twitter user IDs, screen names, or objects. @param options [Hash] A customizable set of options.
Returns true if the authenticating user is blocking a target user
@see dev.twitter.com/docs/api/1/get/blocks/exists @rate_limited Yes @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Boolean] true if the authenticating user is blocking the target user, otherwise false. @param user [Integer, String, Twitter::User] A Twitter user ID, screen name, or object. @param options [Hash] A customizable set of options. @example Check whether the authenticating user is blocking @sferik
Twitter.block?('sferik') Twitter.block?(7505382) # Same as above
Returns an array of numeric user ids the authenticating user is blocking
@see dev.twitter.com/docs/api/1/get/blocks/blocking/ids @rate_limited Yes @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array] Numeric user ids the authenticating user is blocking. @param options [Hash] A customizable set of options. @example Return an array of numeric user ids the authenticating user is blocking
Twitter.blocking_ids
Returns an array of user objects that the authenticating user is blocking
@see dev.twitter.com/docs/api/1/get/blocks/blocking @rate_limited Yes @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::User>] User objects that the authenticating user is blocking. @param options [Hash] A customizable set of options. @option options [Integer] :page Specifies the page of results to retrieve. @example Return an array of user objects that the authenticating user is blocking
Twitter.blocking
Returns the current configuration used by Twitter
@see dev.twitter.com/docs/api/1/get/help/configuration @rate_limited Yes @authentication_required No @return [Twitter::Configuration] Twitter‘s configuration. @example Return the current configuration used by Twitter
Twitter.configuration
Returns an array of users that the specified user can contribute to
@see dev.twitter.com/docs/api/1/get/users/contributees @rate_limited Yes @authentication_required No unless requesting it from a protected user @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::User>] @overload contributees(options={})
@param options [Hash] A customizable set of options. @option options [Boolean, String, Integer] :skip_status Do not include contributee's Tweets when set to true, 't' or 1. @example Return the authenticated user's contributees Twitter.contributees
@overload contributees(user, options={})
@param user [Integer, String, Twitter::User] A Twitter user ID, screen name, or object. @param options [Hash] A customizable set of options. @option options [Boolean, String, Integer] :skip_status Do not include contributee's Tweets when set to true, 't' or 1. @example Return users @sferik can contribute to Twitter.contributees('sferik') Twitter.contributees(7505382) # Same as above
Returns an array of users who can contribute to the specified account
@see dev.twitter.com/docs/api/1/get/users/contributors @rate_limited Yes @authentication_required No unless requesting it from a protected user @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::User>] @overload contributors(options={})
@param options [Hash] A customizable set of options. @option options [Boolean, String, Integer] :skip_status Do not include contributee's Tweets when set to true, 't' or 1. @example Return the authenticated user's contributors Twitter.contributors
@overload contributors(user, options={})
@param user [Integer, String, Twitter::User] A Twitter user ID, screen name, or object. @param options [Hash] A customizable set of options. @option options [Boolean, String, Integer] :skip_status Do not include contributee's Tweets when set to true, 't' or 1. @example Return users who can contribute to @sferik's account Twitter.contributors('sferik') Twitter.contributors(7505382) # Same as above
Allows the authenticating user to deny the specified users’ follow requests
@note Undocumented @rate_limited No @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::User>] The denied users. @overload deny(*users)
@param users [Array<Integer, String, Twitter::User>, Set<Integer, String, Twitter::User>] An array of Twitter user IDs, screen names, or objects. @example Deny @sferik's follow request Twitter.deny('sferik')
@overload deny(*users, options)
@param users [Array<Integer, String, Twitter::User>, Set<Integer, String, Twitter::User>] An array of Twitter user IDs, screen names, or objects. @param options [Hash] A customizable set of options.
Returns a direct message
@see dev.twitter.com/docs/api/1/get/direct_messages/show/%3Aid @note This method requires an access token with RWD (read, write & direct message) permissions. Consult The Application Permission Model for more information. @rate_limited Yes @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Twitter::DirectMessage] The requested messages. @param id [Integer] A Tweet IDs. @param options [Hash] A customizable set of options. @example Return the direct message with the id 1825786345
Twitter.direct_message(1825786345)
Sends a new direct message to the specified user from the authenticating user
@see dev.twitter.com/docs/api/1/post/direct_messages/new @rate_limited No @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Twitter::DirectMessage] The sent message. @param user [Integer, String, Twitter::User] A Twitter user ID, screen name, or object. @param text [String] The text of your direct message, up to 140 characters. @param options [Hash] A customizable set of options. @example Send a direct message to @sferik from the authenticating user
Twitter.direct_message_create('sferik', "I'm sending you this message via @gem!") Twitter.direct_message_create(7505382, "I'm sending you this message via @gem!") # Same as above
Destroys direct messages
@see dev.twitter.com/docs/api/1/post/direct_messages/destroy/:id @note This method requires an access token with RWD (read, write & direct message) permissions. Consult The Application Permission Model for more information. @rate_limited No @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::DirectMessage>] Deleted direct message. @overload direct_message_destroy(*ids)
@param ids [Array<Integer>, Set<Integer>] An array of Tweet IDs. @example Destroys the direct message with the ID 1825785544 Twitter.direct_message_destroy(1825785544)
@overload direct_message_destroy(*ids, options)
@param ids [Array<Integer>, Set<Integer>] An array of Tweet IDs. @param options [Hash] A customizable set of options.
@note This method requires an access token with RWD (read, write & direct message) permissions. Consult The Application Permission Model for more information. @rate_limited Yes @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::DirectMessage>] The requested messages. @overload direct_messages(options={})
Returns the 20 most recent direct messages sent to the authenticating user @see https://dev.twitter.com/docs/api/1/get/direct_messages @param options [Hash] A customizable set of options. @option options [Integer] :since_id Returns results with an ID greater than (that is, more recent than) the specified ID. @option options [Integer] :max_id Returns results with an ID less than (that is, older than) or equal to the specified ID. @option options [Integer] :count Specifies the number of records to retrieve. Must be less than or equal to 200. @option options [Integer] :page Specifies the page of results to retrieve. @example Return the 20 most recent direct messages sent to the authenticating user Twitter.direct_messages
@overload direct_messages(*ids)
Returns direct messages @see https://dev.twitter.com/docs/api/1/get/direct_messages/show/%3Aid @param ids [Array<Integer>, Set<Integer>] An array of Tweet IDs. @example Return the direct message with the id 1825786345 Twitter.direct_messages(1825786345)
@overload direct_messages(*ids, options)
Returns direct messages @see https://dev.twitter.com/docs/api/1/get/direct_messages/show/%3Aid @param ids [Array<Integer>, Set<Integer>] An array of Tweet IDs. @param options [Hash] A customizable set of options.
Returns the 20 most recent direct messages sent to the authenticating user
@see dev.twitter.com/docs/api/1/get/direct_messages @note This method requires an access token with RWD (read, write & direct message) permissions. Consult The Application Permission Model for more information. @rate_limited Yes @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::DirectMessage>] Direct messages sent to the authenticating user. @param options [Hash] A customizable set of options. @option options [Integer] :since_id Returns results with an ID greater than (that is, more recent than) the specified ID. @option options [Integer] :max_id Returns results with an ID less than (that is, older than) or equal to the specified ID. @option options [Integer] :count Specifies the number of records to retrieve. Must be less than or equal to 200. @option options [Integer] :page Specifies the page of results to retrieve. @example Return the 20 most recent direct messages sent to the authenticating user
Twitter.direct_messages_received
Returns the 20 most recent direct messages sent by the authenticating user
@see dev.twitter.com/docs/api/1/get/direct_messages/sent @note This method requires an access token with RWD (read, write & direct message) permissions. Consult The Application Permission Model for more information. @rate_limited Yes @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::DirectMessage>] Direct messages sent by the authenticating user. @param options [Hash] A customizable set of options. @option options [Integer] :since_id Returns results with an ID greater than (that is, more recent than) the specified ID. @option options [Integer] :max_id Returns results with an ID less than (that is, older than) or equal to the specified ID. @option options [Integer] :count Specifies the number of records to retrieve. Must be less than or equal to 200. @option options [Integer] :page Specifies the page of results to retrieve. @example Return the 20 most recent direct messages sent by the authenticating user
Twitter.direct_messages_sent
Disables notifications for updates from the specified users to the authenticating user
@see dev.twitter.com/docs/api/1/post/notifications/leave @rate_limited No @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::User>] The specified users. @overload disable_notifications(*users)
@param users [Array<Integer, String, Twitter::User>, Set<Integer, String, Twitter::User>] An array of Twitter user IDs, screen names, or objects. @example Disable device notifications for updates from @sferik Twitter.disable_notifications('sferik') Twitter.disable_notifications(7505382) # Same as above
@overload disable_notifications(*users, options)
@param users [Array<Integer, String, Twitter::User>, Set<Integer, String, Twitter::User>] An array of Twitter user IDs, screen names, or objects. @param options [Hash] A customizable set of options.
Enables device notifications for updates from the specified users to the authenticating user
@see dev.twitter.com/docs/api/1/post/notifications/follow @rate_limited No @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::User>] The specified users. @overload enable_notifications(*users)
@param users [Array<Integer, String, Twitter::User>, Set<Integer, String, Twitter::User>] An array of Twitter user IDs, screen names, or objects. @example Enable device notifications for updates from @sferik Twitter.enable_notifications('sferik') Twitter.enable_notifications(7505382) # Same as above
@overload enable_notifications(*users, options)
@param users [Array<Integer, String, Twitter::User>, Set<Integer, String, Twitter::User>] An array of Twitter user IDs, screen names, or objects. @param options [Hash] A customizable set of options.
Ends the session of the authenticating user
@see dev.twitter.com/docs/api/1/post/account/end_session @rate_limited No @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Hash] @param options [Hash] A customizable set of options. @example End the session of the authenticating user
Twitter.end_session
Favorites the specified Tweets as the authenticating user
@see dev.twitter.com/docs/api/1/post/favorites/create/:id @rate_limited No @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::Tweet>] The favorited Tweets. @overload favorite(*ids)
@param ids [Array<Integer>, Set<Integer>] An array of Tweet IDs. @example Favorite the Tweet with the ID 25938088801 Twitter.favorite(25938088801)
@overload favorite(*ids, options)
@param ids [Array<Integer>, Set<Integer>] An array of Tweet IDs. @param options [Hash] A customizable set of options.
@see dev.twitter.com/docs/api/1/get/favorites @rate_limited Yes @authentication_required No @return [Array<Twitter::Tweet>] favorite Tweets. @overload favorites(options={})
Returns the 20 most recent favorite Tweets for the authenticating user @param options [Hash] A customizable set of options. @option options [Integer] :count Specifies the number of records to retrieve. Must be less than or equal to 100. @option options [Integer] :since_id Returns results with an ID greater than (that is, more recent than) the specified ID. @example Return the 20 most recent favorite Tweets for the authenticating user Twitter.favorites
@overload favorites(user, options={})
Returns the 20 most recent favorite Tweets for the specified user @param user [Integer, String, Twitter::User] A Twitter user ID, screen name, or object. @param options [Hash] A customizable set of options. @option options [Integer] :count Specifies the number of records to retrieve. Must be less than or equal to 100. @option options [Integer] :since_id Returns results with an ID greater than (that is, more recent than) the specified ID. @example Return the 20 most recent favorite Tweets for @sferik Twitter.favorites('sferik')
Allows the authenticating user to follow the specified users, unless they are already followed
@see dev.twitter.com/docs/api/1/post/friendships/create @rate_limited No @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::User>] The followed users. @overload(*users)
@param users [Array<Integer, String, Twitter::User>, Set<Integer, String, Twitter::User>] An array of Twitter user IDs, screen names, or objects. @example Follow @sferik Twitter.follow('sferik')
@overload(*users, options)
@param users [Array<Integer, String, Twitter::User>, Set<Integer, String, Twitter::User>] An array of Twitter user IDs, screen names, or objects. @param options [Hash] A customizable set of options. @option options [Boolean] :follow (false) Enable notifications for the target user.
Allows the authenticating user to follow the specified users
@see dev.twitter.com/docs/api/1/post/friendships/create @rate_limited No @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::User>] The followed users. @overload follow!(*users)
@param users [Array<Integer, String, Twitter::User>, Set<Integer, String, Twitter::User>] An array of Twitter user IDs, screen names, or objects. @example Follow @sferik Twitter.follow!('sferik')
@overload follow!(*users, options)
@param users [Array<Integer, String, Twitter::User>, Set<Integer, String, Twitter::User>] An array of Twitter user IDs, screen names, or objects. @param options [Hash] A customizable set of options. @option options [Boolean] :follow (false) Enable notifications for the target user.
@see dev.twitter.com/docs/api/1/get/followers/ids @rate_limited Yes @authentication_required No unless requesting it from a protected user @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Twitter::Cursor] @overload follower_ids(options={})
Returns an array of numeric IDs for every user following the authenticated user @param options [Hash] A customizable set of options. @option options [Integer] :cursor (-1) Breaks the results into pages. Provide values as returned in the response objects's next_cursor and previous_cursor attributes to page back and forth in the list. @example Return the authenticated user's followers' IDs Twitter.follower_ids
@overload follower_ids(user, options={})
Returns an array of numeric IDs for every user following the specified user @param user [Integer, String, Twitter::User] A Twitter user ID, screen name, or object. @param options [Hash] A customizable set of options. @option options [Integer] :cursor (-1) Breaks the results into pages. This is recommended for users who are following many users. Provide a value of -1 to begin paging. Provide values as returned in the response body's next_cursor and previous_cursor attributes to page back and forth in the list. @example Return @sferik's followers' IDs Twitter.follower_ids('sferik') Twitter.follower_ids(7505382) # Same as above
@note Undocumented @rate_limited Yes @authentication_required Yes
@overload following_followers_of(options={})
Returns users following followers of the specified user @param options [Hash] A customizable set of options. @option options [Integer] :cursor (-1) Breaks the results into pages. Provide values as returned in the response objects's next_cursor and previous_cursor attributes to page back and forth in the list. @return [Twitter::Cursor] @example Return users follow followers of @sferik Twitter.following_followers_of
@overload following_followers_of(user, options={})
Returns users following followers of the authenticated user @param user [Integer, String, Twitter::User] A Twitter user ID, screen name, or object. @param options [Hash] A customizable set of options. @option options [Integer] :cursor (-1) Breaks the results into pages. Provide values as returned in the response objects's next_cursor and previous_cursor attributes to page back and forth in the list. @return [Twitter::Cursor] @example Return users follow followers of @sferik Twitter.following_followers_of('sferik') Twitter.following_followers_of(7505382) # Same as above
@see dev.twitter.com/docs/api/1/get/friends/ids @rate_limited Yes @authentication_required No unless requesting it from a protected user @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Twitter::Cursor] @overload friend_ids(options={})
Returns an array of numeric IDs for every user the authenticated user is following @param options [Hash] A customizable set of options. @option options [Integer] :cursor (-1) Breaks the results into pages. This is recommended for users who are following many users. Provide a value of -1 to begin paging. Provide values as returned in the response body's next_cursor and previous_cursor attributes to page back and forth in the list. @example Return the authenticated user's friends' IDs Twitter.friend_ids
@overload friend_ids(user, options={})
Returns an array of numeric IDs for every user the specified user is following @param user [Integer, String, Twitter::User] A Twitter user ID, screen name, or object. @param options [Hash] A customizable set of options. @option options [Integer] :cursor (-1) Breaks the results into pages. Provide values as returned in the response objects's next_cursor and previous_cursor attributes to page back and forth in the list. @example Return @sferik's friends' IDs Twitter.friend_ids('sferik') Twitter.friend_ids(7505382) # Same as above
Returns detailed information about the relationship between two users
@see dev.twitter.com/docs/api/1/get/friendships/show @rate_limited Yes @authentication_required No @return [Twitter::Relationship] @param source [Integer, String, Twitter::User] The Twitter user ID, screen name, or object of the source user. @param target [Integer, String, Twitter::User] The Twitter user ID, screen name, or object of the target user. @param options [Hash] A customizable set of options. @example Return the relationship between @sferik and @pengwynn
Twitter.friendship('sferik', 'pengwynn') Twitter.friendship('sferik', 14100886) # Same as above Twitter.friendship(7505382, 14100886) # Same as above
Test for the existence of friendship between two users
@see dev.twitter.com/docs/api/1/get/friendships/exists @note Consider using {Twitter::API::Friendships#friendship} instead of this method. @rate_limited Yes @authentication_required No unless user_a or user_b is protected @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Boolean] true if user_a follows user_b, otherwise false. @param user_a [Integer, String, Twitter::User] The Twitter user ID, screen name, or object of the subject user. @param user_b [Integer, String, Twitter::User] The Twitter user ID, screen name, or object of the user to test for following. @param options [Hash] A customizable set of options. @example Return true if @sferik follows @pengwynn
Twitter.friendship?('sferik', 'pengwynn') Twitter.friendship?('sferik', 14100886) # Same as above Twitter.friendship?(7505382, 14100886) # Same as above
Allows one to enable or disable retweets and device notifications from the specified user.
@see dev.twitter.com/docs/api/1/post/friendships/update @rate_limited No @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Twitter::Relationship] @param user [Integer, String, Twitter::User] A Twitter user ID, screen name, or object. @param options [Hash] A customizable set of options. @option options [Boolean] :device Enable/disable device notifications from the target user. @option options [Boolean] :retweets Enable/disable retweets from the target user. @example Enable rewteets and devise notifications for @sferik
Twitter.friendship_update('sferik', :device => true, :retweets => true)
Returns the relationship of the authenticating user to the comma separated list of up to 100 screen_names or user_ids provided. Values for connections can be: following, following_requested, followed_by, none.
@see dev.twitter.com/docs/api/1/get/friendships/lookup @rate_limited Yes @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::User>] The requested users. @overload friendships(*users)
@param users [Array<Integer, String, Twitter::User>, Set<Integer, String, Twitter::User>] An array of Twitter user IDs, screen names, or objects. @example Return extended information for @sferik and @pengwynn Twitter.friendships('sferik', 'pengwynn') Twitter.friendships('sferik', 14100886) # Same as above Twitter.friendships(7505382, 14100886) # Same as above
@overload friendships(*users, options)
@param users [Array<Integer, String, Twitter::User>, Set<Integer, String, Twitter::User>] An array of Twitter user IDs, screen names, or objects. @param options [Hash] A customizable set of options.
Returns an array of numeric IDs for every user who has a pending request to follow the authenticating user
@see dev.twitter.com/docs/api/1/get/friendships/incoming @rate_limited Yes @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Twitter::Cursor] @param options [Hash] A customizable set of options. @option options [Integer] :cursor (-1) Breaks the results into pages. Provide values as returned in the response objects‘s next_cursor and previous_cursor attributes to page back and forth in the list. @example Return an array of numeric IDs for every user who has a pending request to follow the authenticating user
Twitter.friendships_incoming
Returns an array of numeric IDs for every protected user for whom the authenticating user has a pending follow request
@see dev.twitter.com/docs/api/1/get/friendships/outgoing @rate_limited Yes @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Twitter::Cursor] @param options [Hash] A customizable set of options. @option options [Integer] :cursor (-1) Breaks the results into pages. Provide values as returned in the response objects‘s next_cursor and previous_cursor attributes to page back and forth in the list. @example Return an array of numeric IDs for every protected user for whom the authenticating user has a pending follow request
Twitter.friendships_outgoing
Returns the 20 most recent Tweets, including retweets if they exist, posted by the authenticating user and the users they follow
@see dev.twitter.com/docs/api/1/get/statuses/home_timeline @note This method can only return up to 800 Tweets, including retweets. @rate_limited Yes @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::Tweet>] @param options [Hash] A customizable set of options. @option options [Integer] :since_id Returns results with an ID greater than (that is, more recent than) the specified ID. @option options [Integer] :max_id Returns results with an ID less than (that is, older than) or equal to the specified ID. @option options [Integer] :count Specifies the number of records to retrieve. Must be less than or equal to 200. @option options [Boolean, String, Integer] :trim_user 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. @option options [Boolean, String, Integer] :exclude_replies This parameter will prevent replies from appearing in the returned timeline. Using exclude_replies with the count parameter will mean you will receive up-to count tweets - this is because the count parameter retrieves that many tweets before filtering out retweets and replies. @option options [Boolean, String, Integer] :include_rts Specifies that the timeline should include native retweets in addition to regular tweets. Note: If you‘re using the trim_user parameter in conjunction with include_rts, the retweets will no longer contain a full user object. @option options [Boolean, String, Integer] :include_entities Specifies that each tweet should include an ‘entities’ node including metadata about the tweet such as: user_mentions, urls, and hashtags. @option options [Boolean] :contributor_details Specifies that the contributors element should be enhanced to include the screen_name of the contributor. @example Return the 20 most recent Tweets, including retweets if they exist, posted by the authenticating user and the users they follow
Twitter.home_timeline
Returns the list of languages supported by Twitter
@see dev.twitter.com/docs/api/1/get/help/languages @rate_limited Yes @authentication_required No @return [Array<Twitter::Language>] @example Return the list of languages Twitter supports
Twitter.languages
Show the specified list
@see dev.twitter.com/docs/api/1/get/lists/show @note Private lists will only be shown if the authenticated user owns the specified list. @rate_limited Yes @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Twitter::List] The specified list. @overload list(list, options={})
@param list [Integer, String, Twitter::List] A Twitter list ID, slug, or object. @param options [Hash] A customizable set of options. @example Show the authenticated user's "presidents" list Twitter.list('presidents') Twitter.list(8863586)
@overload list(user, list, options={})
@param user [Integer, String, Twitter::User] A Twitter user ID, screen name, or object. @param list [Integer, String, Twitter::List] A Twitter list ID, slug, or object. @param options [Hash] A customizable set of options. @example Show @sferik's "presidents" list Twitter.list('sferik', 'presidents') Twitter.list('sferik', 8863586) Twitter.list(7505382, 'presidents') Twitter.list(7505382, 8863586)
Add a member to a list
@see dev.twitter.com/docs/api/1/post/lists/members/create @note Lists are limited to having 500 members. @rate_limited No @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Twitter::List] The list. @overload list_add_member(list, user_to_add, options={})
@param list [Integer, String, Twitter::List] A Twitter list ID, slug, or object. @param user_to_add [Integer, String] The user id or screen name to add to the list. @param options [Hash] A customizable set of options. @example Add @BarackObama to the authenticated user's "presidents" list Twitter.list_add_member('presidents', 813286) Twitter.list_add_member(8863586, 813286)
@overload list_add_member(user, list, user_to_add, options={})
@param user [Integer, String, Twitter::User] A Twitter user ID, screen name, or object. @param list [Integer, String, Twitter::List] A Twitter list ID, slug, or object. @param user_to_add [Integer, String] The user id or screen name to add to the list. @param options [Hash] A customizable set of options. @example Add @BarackObama to @sferik's "presidents" list Twitter.list_add_member('sferik', 'presidents', 813286) Twitter.list_add_member('sferik', 8863586, 813286) Twitter.list_add_member(7505382, 'presidents', 813286) Twitter.list_add_member(7505382, 8863586, 813286)
Adds specified members to a list
@see dev.twitter.com/docs/api/1/post/lists/members/create_all @note Lists are limited to having 500 members, and you are limited to adding up to 100 members to a list at a time with this method. @rate_limited No @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Twitter::List] The list. @overload list_add_members(list, users, options={})
@param list [Integer, String, Twitter::List] A Twitter list ID, slug, or object. @param users [Array<Integer, String, Twitter::User>, Set<Integer, String, Twitter::User>] An array of Twitter user IDs, screen names, or objects. @param options [Hash] A customizable set of options. @example Add @BarackObama and @pengwynn to the authenticated user's "presidents" list Twitter.list_add_members('presidents', ['BarackObama', 'pengwynn']) Twitter.list_add_members('presidents', [813286, 18755393]) Twitter.list_add_members(8863586, ['BarackObama', 'pengwynn']) Twitter.list_add_members(8863586, [813286, 18755393])
@overload list_add_members(user, list, users, options={})
@param user [Integer, String, Twitter::User] A Twitter user ID, screen name, or object. @param list [Integer, String, Twitter::List] A Twitter list ID, slug, or object. @param users [Array<Integer, String, Twitter::User>, Set<Integer, String, Twitter::User>] An array of Twitter user IDs, screen names, or objects. @param options [Hash] A customizable set of options. @example Add @BarackObama and @pengwynn to @sferik's "presidents" list Twitter.list_add_members('sferik', 'presidents', ['BarackObama', 'pengwynn']) Twitter.list_add_members('sferik', 'presidents', [813286, 18755393]) Twitter.list_add_members(7505382, 'presidents', ['BarackObama', 'pengwynn']) Twitter.list_add_members(7505382, 'presidents', [813286, 18755393]) Twitter.list_add_members(7505382, 8863586, ['BarackObama', 'pengwynn']) Twitter.list_add_members(7505382, 8863586, [813286, 18755393])
Creates a new list for the authenticated user
@see dev.twitter.com/docs/api/1/post/lists/create @note Accounts are limited to 20 lists. @rate_limited No @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Twitter::List] The created list. @param name [String] The name for the list. @param options [Hash] A customizable set of options. @option options [String] :mode (‘public’) Whether your list is public or private. Values can be ‘public’ or ‘private’. @option options [String] :description The description to give the list. @example Create a list named ‘presidents‘
Twitter.list_create('presidents')
Deletes the specified list
@see dev.twitter.com/docs/api/1/post/lists/destroy @note Must be owned by the authenticated user. @rate_limited No @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Twitter::List] The deleted list. @overload list_destroy(list, options={})
@param list [Integer, String, Twitter::List] A Twitter list ID, slug, or object. @param options [Hash] A customizable set of options. @example Delete the authenticated user's "presidents" list Twitter.list_destroy('presidents') Twitter.list_destroy(8863586)
@overload list_destroy(user, list, options={})
@param user [Integer, String, Twitter::User] A Twitter user ID, screen name, or object. @param list [Integer, String, Twitter::List] A Twitter list ID, slug, or object. @param options [Hash] A customizable set of options. @example Delete @sferik's "presidents" list Twitter.list_destroy('sferik', 'presidents') Twitter.list_destroy('sferik', 8863586) Twitter.list_destroy(7505382, 'presidents') Twitter.list_destroy(7505382, 8863586)
Check if a user is a member of the specified list
@see dev.twitter.com/docs/api/1/get/lists/members/show @authentication_required Yes @rate_limited Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Boolean] true if user is a member of the specified list, otherwise false. @overload list_member?(list, user_to_check, options={})
@param list [Integer, String, Twitter::List] A Twitter list ID, slug, or object. @param user_to_check [Integer, String] The user ID or screen name of the list member. @param options [Hash] A customizable set of options. @example Check if @BarackObama is a member of the authenticated user's "presidents" list Twitter.list_member?('presidents', 813286) Twitter.list_member?(8863586, 'BarackObama')
@overload list_member?(user, list, user_to_check, options={})
@param user [Integer, String, Twitter::User] A Twitter user ID, screen name, or object. @param list [Integer, String, Twitter::List] A Twitter list ID, slug, or object. @param user_to_check [Integer, String] The user ID or screen name of the list member. @param options [Hash] A customizable set of options. @example Check if @BarackObama is a member of @sferik's "presidents" list Twitter.list_member?('sferik', 'presidents', 813286) Twitter.list_member?('sferik', 8863586, 'BarackObama') Twitter.list_member?(7505382, 'presidents', 813286)
Returns the members of the specified list
@see dev.twitter.com/docs/api/1/get/lists/members @rate_limited Yes @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Twitter::Cursor] @overload list_members(list, options={})
@param list [Integer, String, Twitter::List] A Twitter list ID, slug, or object. @param options [Hash] A customizable set of options. @option options [Integer] :cursor (-1) Breaks the results into pages. Provide values as returned in the response objects's next_cursor and previous_cursor attributes to page back and forth in the list. @example Return the members of the authenticated user's "presidents" list Twitter.list_members('presidents') Twitter.list_members(8863586)
@overload list_members(user, list, options={})
@param user [Integer, String, Twitter::User] A Twitter user ID, screen name, or object. @param list [Integer, String, Twitter::List] A Twitter list ID, slug, or object. @param options [Hash] A customizable set of options. @option options [Integer] :cursor (-1) Breaks the results into pages. Provide values as returned in the response objects's next_cursor and previous_cursor attributes to page back and forth in the list. @example Return the members of @sferik's "presidents" list Twitter.list_members('sferik', 'presidents') Twitter.list_members('sferik', 8863586) Twitter.list_members(7505382, 'presidents') Twitter.list_members(7505382, 8863586)
Removes the specified member from the list
@see dev.twitter.com/docs/api/1/post/lists/members/destroy @rate_limited No @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Twitter::List] The list. @overload list_remove_member(list, user_to_remove, options={})
@param list [Integer, String, Twitter::List] A Twitter list ID, slug, or object. @param user_to_remove [Integer, String] The user id or screen name of the list member to remove. @param options [Hash] A customizable set of options. @example Remove @BarackObama from the authenticated user's "presidents" list Twitter.list_remove_member('presidents', 813286) Twitter.list_remove_member('presidents', 'BarackObama') Twitter.list_remove_member(8863586, 'BarackObama')
@overload list_remove_member(user, list, user_to_remove, options={})
@param user [Integer, String, Twitter::User] A Twitter user ID, screen name, or object. @param list [Integer, String, Twitter::List] A Twitter list ID, slug, or object. @param user_to_remove [Integer, String] The user id or screen name of the list member to remove. @param options [Hash] A customizable set of options. @example Remove @BarackObama from @sferik's "presidents" list Twitter.list_remove_member('sferik', 'presidents', 813286) Twitter.list_remove_member('sferik', 'presidents', 'BarackObama') Twitter.list_remove_member('sferik', 8863586, 'BarackObama') Twitter.list_remove_member(7505382, 'presidents', 813286)
Removes specified members from the list
@see dev.twitter.com/docs/api/1/post/lists/members/destroy_all @rate_limited No @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Twitter::List] The list. @overload list_remove_members(list, users, options={})
@param list [Integer, String, Twitter::List] A Twitter list ID, slug, or object. @param users [Array<Integer, String, Twitter::User>, Set<Integer, String, Twitter::User>] An array of Twitter user IDs, screen names, or objects. @param options [Hash] A customizable set of options. @example Remove @BarackObama and @pengwynn from the authenticated user's "presidents" list Twitter.list_remove_members('presidents', ['BarackObama', 'pengwynn']) Twitter.list_remove_members('presidents', [813286, 18755393]) Twitter.list_remove_members(8863586, ['BarackObama', 'pengwynn']) Twitter.list_remove_members(8863586, [813286, 18755393])
@overload list_remove_members(user, list, users, options={})
@param user [Integer, String, Twitter::User] A Twitter user ID, screen name, or object. @param list [Integer, String, Twitter::List] A Twitter list ID, slug, or object. @param users [Array<Integer, String, Twitter::User>, Set<Integer, String, Twitter::User>] An array of Twitter user IDs, screen names, or objects. @param options [Hash] A customizable set of options. @example Remove @BarackObama and @pengwynn from @sferik's "presidents" list Twitter.list_remove_members('sferik', 'presidents', ['BarackObama', 'pengwynn']) Twitter.list_remove_members('sferik', 'presidents', [813286, 18755393]) Twitter.list_remove_members(7505382, 'presidents', ['BarackObama', 'pengwynn']) Twitter.list_remove_members(7505382, 'presidents', [813286, 18755393]) Twitter.list_remove_members(7505382, 8863586, ['BarackObama', 'pengwynn']) Twitter.list_remove_members(7505382, 8863586, [813286, 18755393])
Make the authenticated user follow the specified list
@see dev.twitter.com/docs/api/1/post/lists/subscribers/create @rate_limited No @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Twitter::List] The specified list. @overload list_subscribe(list, options={})
@param list [Integer, String, Twitter::List] A Twitter list ID, slug, or object. @param options [Hash] A customizable set of options. @example Subscribe to the authenticated user's "presidents" list Twitter.list_subscribe('presidents') Twitter.list_subscribe(8863586)
@overload list_subscribe(user, list, options={})
@param user [Integer, String, Twitter::User] A Twitter user ID, screen name, or object. @param list [Integer, String, Twitter::List] A Twitter list ID, slug, or object. @param options [Hash] A customizable set of options. @example Subscribe to @sferik's "presidents" list Twitter.list_subscribe('sferik', 'presidents') Twitter.list_subscribe('sferik', 8863586) Twitter.list_subscribe(7505382, 'presidents')
Check if a user is a subscriber of the specified list
@see dev.twitter.com/docs/api/1/get/lists/subscribers/show @rate_limited Yes @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Boolean] true if user is a subscriber of the specified list, otherwise false. @overload list_subscriber?(list, user_to_check, options={})
@param list [Integer, String, Twitter::List] A Twitter list ID, slug, or object. @param user_to_check [Integer, String, Twitter::User] A Twitter user ID, screen name, or object. @param options [Hash] A customizable set of options. @example Check if @BarackObama is a subscriber of the authenticated user's "presidents" list Twitter.list_subscriber?('presidents', 813286) Twitter.list_subscriber?(8863586, 813286) Twitter.list_subscriber?('presidents', 'BarackObama')
@overload list_subscriber?(user, list, user_to_check, options={})
@param user [Integer, String, Twitter::User] A Twitter user ID, screen name, or object. @param list [Integer, String, Twitter::List] A Twitter list ID, slug, or object. @param user_to_check [Integer, String, Twitter::User] A Twitter user ID, screen name, or object. @param options [Hash] A customizable set of options. @example Check if @BarackObama is a subscriber of @sferik's "presidents" list Twitter.list_subscriber?('sferik', 'presidents', 813286) Twitter.list_subscriber?('sferik', 8863586, 813286) Twitter.list_subscriber?(7505382, 'presidents', 813286) Twitter.list_subscriber?('sferik', 'presidents', 'BarackObama')
@return [Boolean] true if user is a subscriber of the specified list, otherwise false.
Returns the subscribers of the specified list
@see dev.twitter.com/docs/api/1/get/lists/subscribers @rate_limited Yes @authentication_required Supported @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Twitter::Cursor] The subscribers of the specified list. @overload list_subscribers(list, options={})
@param list [Integer, String, Twitter::List] A Twitter list ID, slug, or object. @param options [Hash] A customizable set of options. @option options [Integer] :cursor (-1) Breaks the results into pages. Provide values as returned in the response objects's next_cursor and previous_cursor attributes to page back and forth in the list. @example Return the subscribers of the authenticated user's "presidents" list Twitter.list_subscribers('presidents') Twitter.list_subscribers(8863586)
@overload list_subscribers(user, list, options={})
@param user [Integer, String, Twitter::User] A Twitter user ID, screen name, or object. @param list [Integer, String, Twitter::List] A Twitter list ID, slug, or object. @param options [Hash] A customizable set of options. @option options [Integer] :cursor (-1) Breaks the results into pages. Provide values as returned in the response objects's next_cursor and previous_cursor attributes to page back and forth in the list. @example Return the subscribers of @sferik's "presidents" list Twitter.list_subscribers('sferik', 'presidents') Twitter.list_subscribers('sferik', 8863586) Twitter.list_subscribers(7505382, 'presidents')
Show tweet timeline for members of the specified list
@see dev.twitter.com/docs/api/1/get/lists/statuses @rate_limited Yes @authentication_required No @return [Array<Twitter::Tweet>] @overload list_timeline(list, options={})
@param list [Integer, String, Twitter::List] A Twitter list ID, slug, or object. @param options [Hash] A customizable set of options. @option options [Integer] :since_id Returns results with an ID greater than (that is, more recent than) the specified ID. @option options [Integer] :max_id Returns results with an ID less than (that is, older than) or equal to the specified ID. @option options [Integer] :per_page The number of results to retrieve. @example Show tweet timeline for members of the authenticated user's "presidents" list Twitter.list_timeline('presidents') Twitter.list_timeline(8863586)
@overload list_timeline(user, list, options={})
@param user [Integer, String, Twitter::User] A Twitter user ID, screen name, or object. @param list [Integer, String, Twitter::List] A Twitter list ID, slug, or object. @param options [Hash] A customizable set of options. @option options [Integer] :since_id Returns results with an ID greater than (that is, more recent than) the specified ID. @option options [Integer] :max_id Returns results with an ID less than (that is, older than) or equal to the specified ID. @option options [Integer] :per_page The number of results to retrieve. @example Show tweet timeline for members of @sferik's "presidents" list Twitter.list_timeline('sferik', 'presidents') Twitter.list_timeline('sferik', 8863586) Twitter.list_timeline(7505382, 'presidents') Twitter.list_timeline(7505382, 8863586)
Unsubscribes the authenticated user form the specified list
@see dev.twitter.com/docs/api/1/post/lists/subscribers/destroy @rate_limited No @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Twitter::List] The specified list. @overload list_unsubscribe(list, options={})
@param list [Integer, String, Twitter::List] A Twitter list ID, slug, or object. @param options [Hash] A customizable set of options. @example Unsubscribe from the authenticated user's "presidents" list Twitter.list_unsubscribe('presidents') Twitter.list_unsubscribe(8863586)
@overload list_unsubscribe(user, list, options={})
@param user [Integer, String, Twitter::User] A Twitter user ID, screen name, or object. @param list [Integer, String, Twitter::List] A Twitter list ID, slug, or object. @param options [Hash] A customizable set of options. @example Unsubscribe from @sferik's "presidents" list Twitter.list_unsubscribe('sferik', 'presidents') Twitter.list_unsubscribe('sferik', 8863586) Twitter.list_unsubscribe(7505382, 'presidents')
Updates the specified list
@see dev.twitter.com/docs/api/1/post/lists/update @rate_limited No @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Twitter::List] The created list. @overload list_update(list, options={})
@param list [Integer, String, Twitter::List] A Twitter list ID, slug, or object. @param options [Hash] A customizable set of options. @option options [String] :mode ('public') Whether your list is public or private. Values can be 'public' or 'private'. @option options [String] :description The description to give the list. @example Update the authenticated user's "presidents" list to have the description "Presidents of the United States of America" Twitter.list_update('presidents', :description => "Presidents of the United States of America") Twitter.list_update(8863586, :description => "Presidents of the United States of America")
@overload list_update(user, list, options={})
@param user [Integer, String, Twitter::User] A Twitter user ID, screen name, or object. @param list [Integer, String, Twitter::List] A Twitter list ID, slug, or object. @param options [Hash] A customizable set of options. @option options [String] :mode ('public') Whether your list is public or private. Values can be 'public' or 'private'. @option options [String] :description The description to give the list. @example Update the @sferik's "presidents" list to have the description "Presidents of the United States of America" Twitter.list_update('sferik', 'presidents', :description => "Presidents of the United States of America") Twitter.list_update(7505382, 'presidents', :description => "Presidents of the United States of America") Twitter.list_update('sferik', 8863586, :description => "Presidents of the United States of America") Twitter.list_update(7505382, 8863586, :description => "Presidents of the United States of America")
List the lists of the specified user
@see dev.twitter.com/docs/api/1/get/lists @note Private lists will be included if the authenticated user is the same as the user whose lists are being returned. @rate_limited Yes @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Twitter::Cursor] @overload lists(options={})
@param options [Hash] A customizable set of options. @option options [Integer] :cursor (-1) Breaks the results into pages. Provide values as returned in the response objects's next_cursor and previous_cursor attributes to page back and forth in the list. @example List the authenticated user's lists Twitter.lists
@overload lists(user, options={})
@param user [Integer, String, Twitter::User] A Twitter user ID, screen name, or object. @param options [Hash] A customizable set of options. @option options [Integer] :cursor (-1) Breaks the results into pages. Provide values as returned in the response objects's next_cursor and previous_cursor attributes to page back and forth in the list. @example List @sferik's lists Twitter.lists('sferik') Twitter.lists(7505382)
Returns all lists the authenticating or specified user subscribes to, including their own
@see dev.twitter.com/docs/api/1/get/lists/all @rate_limited Yes @authentication_required Supported @return [Array<Twitter::List>] @overload lists_subscribed_to(options={})
@param options [Hash] A customizable set of options. @example Return all lists the authenticating user subscribes to Twitter.lists_subscribed_to
@overload lists_subscribed_to(user, options={})
@param user [Integer, String, Twitter::User] A Twitter user ID, screen name, or object. @param options [Hash] A customizable set of options. @example Return all lists the specified user subscribes to Twitter.lists_subscribed_to('sferik') Twitter.lists_subscribed_to(8863586)
Returns the top 10 trending topics for a specific WOEID
@see dev.twitter.com/docs/api/1/get/trends/:woeid @rate_limited Yes @authentication_required No @param woeid [Integer] The {developer.yahoo.com/geo/geoplanet Yahoo! Where On Earth ID} of the location to return trending information for. WOEIDs can be retrieved by calling {Twitter::API::Trends#trend_locations}. Global information is available by using 1 as the WOEID. @param options [Hash] A customizable set of options. @option options [String] :exclude Setting this equal to ‘hashtags’ will remove all hashtags from the trends list. @return [Array<Twitter::Trend>] @example Return the top 10 trending topics for San Francisco
Twitter.local_trends(2487956)
Returns the 20 most recent images posted by the specified user
@see support.twitter.com/articles/20169409 @note This method can only return up to the 100 most recent images. @note Images will not be returned from tweets posted before January 1, 2010. @rate_limited Yes @authentication_required No, unless the user whose timeline you‘re trying to view is protected @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::Tweet>] @overload media_timeline(user, options={})
@param user [Integer, String, Twitter::User] A Twitter user ID, screen name, or object. @param options [Hash] A customizable set of options. @option options [Integer] :count Specifies the number of records to retrieve. Must be less than or equal to 200. @option options [Boolean] :filter Include possibly sensitive media when set to false, 'f' or 0. @example Return the 20 most recent Tweets posted by @sferik Twitter.media_timeline('sferik')
List the lists the specified user has been added to
@see dev.twitter.com/docs/api/1/get/lists/memberships @rate_limited Yes @authentication_required Supported @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Twitter::Cursor] @overload memberships(options={})
@param options [Hash] A customizable set of options. @option options [Integer] :cursor (-1) Breaks the results into pages. Provide values as returned in the response objects's next_cursor and previous_cursor attributes to page back and forth in the list. @example List the lists the authenticated user has been added to Twitter.memberships
@overload memberships(user, options={})
@param user [Integer, String, Twitter::User] A Twitter user ID, screen name, or object. @param options [Hash] A customizable set of options. @option options [Integer] :cursor (-1) Breaks the results into pages. Provide values as returned in the response objects's next_cursor and previous_cursor attributes to page back and forth in the list. @example List the lists that @sferik has been added to Twitter.memberships('sferik') Twitter.memberships(7505382)
Returns the 20 most recent mentions (statuses containing @username) for the authenticating user
@see dev.twitter.com/docs/api/1/get/statuses/mentions @note This method can only return up to 800 Tweets. @rate_limited Yes @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::Tweet>] @param options [Hash] A customizable set of options. @option options [Integer] :since_id Returns results with an ID greater than (that is, more recent than) the specified ID. @option options [Integer] :max_id Returns results with an ID less than (that is, older than) or equal to the specified ID. @option options [Integer] :count Specifies the number of records to retrieve. Must be less than or equal to 200. @option options [Boolean, String, Integer] :trim_user 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. @example Return the 20 most recent mentions (statuses containing @username) for the authenticating user
Twitter.mentions
Returns the 20 most recent Tweets from the authenticating user‘s network
@note Undocumented @rate_limited Yes @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::Tweet>] @param options [Hash] A customizable set of options. @option options [Integer] :since_id Returns results with an ID greater than (that is, more recent than) the specified ID. @option options [Integer] :max_id Returns results with an ID less than (that is, older than) or equal to the specified ID. @option options [Integer] :count Specifies the number of records to retrieve. Must be less than or equal to 200. @option options [Boolean, String, Integer] :trim_user 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. @option options [Boolean, String, Integer] :exclude_replies This parameter will prevent replies from appearing in the returned timeline. Using exclude_replies with the count parameter will mean you will receive up-to count tweets - this is because the count parameter retrieves that many tweets before filtering out retweets and replies. @example Return the 20 most recent Tweets from the authenticating user‘s network
Twitter.network_timeline
Returns an array of user_ids that the currently authenticated user does not want to see retweets from.
@see dev.twitter.com/docs/api/1/get/friendships/no_retweet_ids @rate_limited Yes @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Integer>] @param options [Hash] A customizable set of options. @option options [Boolean] :stringify_ids Many programming environments will not consume our ids due to their size. Provide this option to have ids returned as strings instead. Read more about Twitter IDs, JSON and Snowflake. @example Enable rewteets and devise notifications for @sferik
Twitter.no_retweet_ids
Returns oEmbed for a Tweet
@see dev.twitter.com/docs/api/1/get/statuses/oembed @rate_limited Yes @authentication_required No, unless the author of the Tweet is protected @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Twitter::OEmbed] OEmbed for the requested Tweet. @param id [Integer, String] A Tweet ID. @param options [Hash] A customizable set of options. @option options [Integer] :maxwidth The maximum width in pixels that the embed should be rendered at. This value is constrained to be between 250 and 550 pixels. @option options [Boolean, String, Integer] :hide_media Specifies whether the embedded Tweet should automatically expand images which were uploaded via {dev.twitter.com/docs/api/1/post/statuses/update_with_media POST statuses/update_with_media}. When set to either true, t or 1 images will not be expanded. Defaults to false. @option options [Boolean, String, Integer] :hide_thread Specifies whether the embedded Tweet should automatically show the original message in the case that the embedded Tweet is a reply. When set to either true, t or 1 the original Tweet will not be shown. Defaults to false. @option options [Boolean, String, Integer] :omit_script Specifies whether the embedded Tweet HTML should include a `<script>` element pointing to widgets.js. In cases where a page already includes widgets.js, setting this value to true will prevent a redundant script element from being included. When set to either true, t or 1 the `<script>` element will not be included in the embed HTML, meaning that pages must include a reference to widgets.js manually. Defaults to false. @option options [String] :align Specifies whether the embedded Tweet should be left aligned, right aligned, or centered in the page. Valid values are left, right, center, and none. Defaults to none, meaning no alignment styles are specified for the Tweet. @option options [String] :related A value for the TWT related parameter, as described in {dev.twitter.com/docs/intents Web Intents}. This value will be forwarded to all Web Intents calls. @option options [String] :lang Language code for the rendered embed. This will affect the text and localization of the rendered HTML. @example Return oEmbeds for Tweet with the ID 25938088801
Twitter.status_with_activity(25938088801)
Returns oEmbeds for Tweets
@see dev.twitter.com/docs/api/1/get/statuses/oembed @rate_limited Yes @authentication_required No, unless the author of the Tweet is protected @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::OEmbed>] OEmbeds for the requested Tweets. @overload oembed(*ids_or_urls)
@param ids_or_urls [Array<Integer, String>, Set<Integer, String>] An array of Tweet IDs or URLs. @example Return oEmbeds for Tweets with the ID 25938088801 Twitter.status_with_activity(25938088801)
@overload oembed(*ids_or_urls, options)
@param ids_or_urls [Array<Integer, String>, Set<Integer, String>] An array of Tweet IDs or URLs. @param options [Hash] A customizable set of options. @option options [Integer] :maxwidth The maximum width in pixels that the embed should be rendered at. This value is constrained to be between 250 and 550 pixels. @option options [Boolean, String, Integer] :hide_media Specifies whether the embedded Tweet should automatically expand images which were uploaded via {https://dev.twitter.com/docs/api/1/post/statuses/update_with_media POST statuses/update_with_media}. When set to either true, t or 1 images will not be expanded. Defaults to false. @option options [Boolean, String, Integer] :hide_thread Specifies whether the embedded Tweet should automatically show the original message in the case that the embedded Tweet is a reply. When set to either true, t or 1 the original Tweet will not be shown. Defaults to false. @option options [Boolean, String, Integer] :omit_script Specifies whether the embedded Tweet HTML should include a `<script>` element pointing to widgets.js. In cases where a page already includes widgets.js, setting this value to true will prevent a redundant script element from being included. When set to either true, t or 1 the `<script>` element will not be included in the embed HTML, meaning that pages must include a reference to widgets.js manually. Defaults to false. @option options [String] :align Specifies whether the embedded Tweet should be left aligned, right aligned, or centered in the page. Valid values are left, right, center, and none. Defaults to none, meaning no alignment styles are specified for the Tweet. @option options [String] :related A value for the TWT related parameter, as described in {https://dev.twitter.com/docs/intents Web Intents}. This value will be forwarded to all Web Intents calls. @option options [String] :lang Language code for the rendered embed. This will affect the text and localization of the rendered HTML.
Returns recent Tweets related to a query with images and videos embedded
@note Undocumented @rate_limited Yes @authentication_required No @param q [String] A search term. @param options [Hash] A customizable set of options. @option options [Integer] :count Specifies the number of records to retrieve. Must be less than or equal to 100. @option options [Integer] :since_id Returns results with an ID greater than (that is, more recent than) the specified ID. @return [Array<Twitter::Tweet>] An array of Tweets that contain videos @example Return recent Tweets related to twitter with images and videos embedded
Twitter.phoenix_search('twitter')
Returns all the information about a known place
@see dev.twitter.com/docs/api/1/get/geo/id/:place_id @rate_limited Yes @authentication_required No @param place_id [String] A place in the world. These IDs can be retrieved from {Twitter::API::Geo#reverse_geocode}. @param options [Hash] A customizable set of options. @return [Twitter::Place] The requested place. @example Return all the information about Twitter HQ
Twitter.place("247f43d441defc03")
Creates a new place at the given latitude and longitude
@see dev.twitter.com/docs/api/1/post/geo/place @rate_limited Yes @authentication_required No @param options [Hash] A customizable set of options. @option options [String] :name The name a place is known as. @option options [String] :contained_within This is 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. @option options [String] :token The token found in the response from {Twitter::API::Geo#places_similar}. @option options [Float] :lat The latitude to search around. 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. @option options [Float] :long The longitude to search around. The valid range 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. @option options [String] :"attribute:street_address" This option searches for places which have this given street address. There are other well-known and application-specific attributes available. Custom attributes are also permitted. @return [Twitter::Place] The created place. @example Create a new place
Twitter.place_create(:name => "@sferik's Apartment", :token => "22ff5b1f7159032cf69218c4d8bb78bc", :contained_within => "41bcb736f84a799e", :lat => "37.783699", :long => "-122.393581")
Search for places that can be attached to a {Twitter::API::Statuses#update}
@see dev.twitter.com/docs/api/1/get/geo/search @rate_limited Yes @authentication_required No @param options [Hash] A customizable set of options. @option options [Float] :lat The latitude to search around. 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. @option options [Float] :long The longitude to search around. The valid range 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. @option options [String] :query Free-form text to match against while executing a geo-based query, best suited for finding nearby locations by name. @option options [String] :ip An IP address. Used when attempting to fix geolocation based off of the user‘s IP address. @option options [String] :granularity (‘neighborhood’) This is the minimal granularity of place types to return and must be one of: ‘poi’, ‘neighborhood’, ‘city’, ‘admin’ or ‘country’. @option options [String] :accuracy (‘0m’) A hint on the "region" in which to search. If a number, then this is a radius in meters, but it can also take a string that is suffixed with ft to specify feet. If coming from a device, in practice, this value is whatever accuracy the device has measuring its location (whether it be coming from a GPS, WiFi triangulation, etc.). @option options [Integer] :max_results A hint as to the number of results to return. This does not guarantee that the number of results returned will equal max_results, but instead informs how many "nearby" results to return. Ideally, only pass in the number of places you intend to display to the user here. @option options [String] :contained_within This is 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. @option options [String] :"attribute:street_address" This option searches for places which have this given street address. There are other well-known and application-specific attributes available. Custom attributes are also permitted. @return [Array<Twitter::Place>] @example Return an array of places near the IP address 74.125.19.104
Twitter.places_nearby(:ip => "74.125.19.104")
Locates places near the given coordinates which are similar in name
@see dev.twitter.com/docs/api/1/get/geo/similar_places @note Conceptually, you would use this method to get a list of known places to choose from first. Then, if the desired place doesn‘t exist, make a request to {Twitter::API::Geo#place} to create a new one. The token contained in the response is the token necessary to create a new place. @rate_limited Yes @authentication_required No @param options [Hash] A customizable set of options. @option options [Float] :lat The latitude to search around. 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. @option options [Float] :long The longitude to search around. The valid range 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. @option options [String] :name The name a place is known as. @option options [String] :contained_within This is 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. @option options [String] :"attribute:street_address" This option searches for places which have this given street address. There are other well-known and application-specific attributes available. Custom attributes are also permitted. @return [Array<Twitter::Place>] @example Return an array of places similar to Twitter HQ
Twitter.places_similar(:lat => "37.7821120598956", :long => "-122.400612831116", :name => "Twitter HQ")
Returns {twitter.com/privacy Twitter‘s Privacy Policy}
@see dev.twitter.com/docs/api/1/get/legal/privacy @rate_limited Yes @authentication_required No @return [String] @example Return {twitter.com/privacy Twitter‘s Privacy Policy}
Twitter.privacy
Returns the remaining number of API requests available to the requesting user
@see dev.twitter.com/docs/api/1/get/account/rate_limit_status @rate_limited No @authentication_required No @return [Twitter::RateLimitStatus] @param options [Hash] A customizable set of options. @example Return the remaining number of API requests available to the requesting user
Twitter.rate_limit_status
Check whether a method is rate limited
@raise [ArgumentError] Error raised when supplied argument is not a key in the METHOD_RATE_LIMITED hash. @return [Boolean] @param method_name [Symbol]
Returns recommended users for the authenticated user
@note {dev.twitter.com/discussions/1120 Undocumented} @rate_limited Yes @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::User>] @overload recommendations(options={})
@param user [Integer, String, Twitter::User] A Twitter user ID, screen name, or object. @param options [Hash] A customizable set of options. @option options [Integer] :limit (20) Specifies the number of records to retrieve. @option options [String] :excluded Comma-separated list of user IDs to exclude. @example Return recommended users for the authenticated user Twitter.recommendations
@overload recommendations(user, options={})
@param user [Integer, String, Twitter::User] A Twitter user ID, screen name, or object. @param options [Hash] A customizable set of options. @option options [Integer] :limit (20) Specifies the number of records to retrieve. @option options [String] :excluded Comma-separated list of user IDs to exclude. @example Return recommended users for the authenticated user Twitter.recommendations("sferik")
Returns tweets related to a given Tweet
@note {dev.twitter.com/discussions/293 Undocumented} @rate_limited Yes @authentication_required No, unless the author of the Tweet is protected @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::Tweet>] @param id [Integer] A Tweet ID. @param options [Hash] A customizable set of options. @example Returns tweets related to the Tweet with the ID 25938088801
Twitter.related_results(25938088801)
The users specified are blocked by the authenticated user and reported as spammers
@see dev.twitter.com/docs/api/1/post/report_spam @rate_limited Yes @authentication_required No @return [Array<Twitter::User>] The reported users. @overload report_spam(*users)
@param users [Array<Integer, String, Twitter::User>, Set<Integer, String, Twitter::User>] An array of Twitter user IDs, screen names, or objects. @example Report @spam for spam Twitter.report_spam("spam") Twitter.report_spam(14589771) # Same as above
@overload report_spam(*users, options)
@param users [Array<Integer, String, Twitter::User>, Set<Integer, String, Twitter::User>] An array of Twitter user IDs, screen names, or objects. @param options [Hash] A customizable set of options.
Retweets tweets
@see dev.twitter.com/docs/api/1/post/statuses/retweet/:id @rate_limited Yes @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::Tweet>] The original tweets with retweet details embedded. @overload retweet(*ids)
@param ids [Array<Integer>, Set<Integer>] An array of Tweet IDs. @example Retweet the Tweet with the ID 28561922516 Twitter.retweet(28561922516)
@overload retweet(*ids, options)
@param ids [Array<Integer>, Set<Integer>] An array of Tweet IDs. @param options [Hash] A customizable set of options. @option options [Boolean, String, Integer] :trim_user 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 the 20 most recent retweets posted by the authenticating user
@see dev.twitter.com/docs/api/1/get/statuses/retweeted_by_me @rate_limited Yes @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::Tweet>] @param options [Hash] A customizable set of options. @option options [Integer] :since_id Returns results with an ID greater than (that is, more recent than) the specified ID. @option options [Integer] :max_id Returns results with an ID less than (that is, older than) or equal to the specified ID. @option options [Integer] :count Specifies the number of records to retrieve. Must be less than or equal to 200. @option options [Boolean, String, Integer] :trim_user 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. @example Return the 20 most recent retweets posted by the authenticating user
Twitter.retweeted_by_me
Returns the 20 most recent retweets posted by the specified user
@see dev.twitter.com/docs/api/1/get/statuses/retweeted_by_user @rate_limited No @authentication_required Supported @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::Tweet>] @param options [Hash] A customizable set of options. @option options [Integer] :since_id Returns results with an ID greater than (that is, more recent than) the specified ID. @option options [Integer] :max_id Returns results with an ID less than (that is, older than) or equal to the specified ID. @option options [Integer] :count Specifies the number of records to retrieve. Must be less than or equal to 200. @option options [Boolean, String, Integer] :trim_user 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. @example Return the 20 most recent retweets posted by the authenticating user
Twitter.retweeted_by_user('sferik')
Returns the 20 most recent retweets posted by users the authenticating user follow.
@see dev.twitter.com/docs/api/1/get/statuses/retweeted_to_me @rate_limited Yes @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::Tweet>] @param options [Hash] A customizable set of options. @option options [Integer] :since_id Returns results with an ID greater than (that is, more recent than) the specified ID. @option options [Integer] :max_id Returns results with an ID less than (that is, older than) or equal to the specified ID. @option options [Integer] :count Specifies the number of records to retrieve. Must be less than or equal to 200. @option options [Boolean, String, Integer] :trim_user 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. @example Return the 20 most recent retweets posted by users followed by the authenticating user
Twitter.retweeted_to_me
Returns the 20 most recent retweets posted by users the specified user follows
@see dev.twitter.com/docs/api/1/get/statuses/retweeted_to_user @rate_limited Yes @authentication_required Supported @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::Tweet>] @param user [Integer, String, Twitter::User] A Twitter user ID, screen name, or object. @param options [Hash] A customizable set of options. @option options [Integer] :since_id Returns results with an ID greater than (that is, more recent than) the specified ID. @option options [Integer] :max_id Returns results with an ID less than (that is, older than) or equal to the specified ID. @option options [Integer] :count Specifies the number of records to retrieve. Must be less than or equal to 200. @option options [Boolean, String, Integer] :trim_user 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. @example Return the 20 most recent retweets posted by users followed by the specified user
Twitter.retweeted_to_user('sferik')
Show up to 100 users who retweeted the Tweet
@see dev.twitter.com/docs/api/1/get/statuses/:id/retweeted_by @see dev.twitter.com/docs/api/1/get/statuses/:id/retweeted_by/ids @rate_limited Yes @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array] @param id [Integer] The numerical ID of the desired Tweet. @param options [Hash] A customizable set of options. @option options [Integer] :count Specifies the number of records to retrieve. Must be less than or equal to 100. @option options [Integer] :page Specifies the page of results to retrieve. @option options [Boolean, String, Integer] :trim_user 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. @option options [Boolean] :ids_only (‘false’) Only return user ids instead of full user objects. @example Show up to 100 users who retweeted the Tweet with the ID 28561922516
Twitter.retweeters_of(28561922516)
Returns up to 100 of the first retweets of a given tweet
@see dev.twitter.com/docs/api/1/get/statuses/retweets/:id @rate_limited Yes @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::Tweet>] @param id [Integer] The numerical ID of the desired Tweet. @param options [Hash] A customizable set of options. @option options [Integer] :count Specifies the number of records to retrieve. Must be less than or equal to 100. @option options [Boolean, String, Integer] :trim_user 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. @example Return up to 100 of the first retweets of the Tweet with the ID 28561922516
Twitter.retweets(28561922516)
Returns the 20 most recent tweets of the authenticated user that have been retweeted by others
@see dev.twitter.com/docs/api/1/get/statuses/retweets_of_me @rate_limited Yes @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::Tweet>] @param options [Hash] A customizable set of options. @option options [Integer] :since_id Returns results with an ID greater than (that is, more recent than) the specified ID. @option options [Integer] :max_id Returns results with an ID less than (that is, older than) or equal to the specified ID. @option options [Integer] :count Specifies the number of records to retrieve. Must be less than or equal to 200. @option options [Boolean, String, Integer] :trim_user 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. @example Return the 20 most recent tweets of the authenticated user that have been retweeted by others
Twitter.retweets_of_me
Searches for up to 20 places that can be used as a place_id
@see dev.twitter.com/docs/api/1/get/geo/reverse_geocode @note This request is an informative call and will deliver generalized results about geography. @rate_limited Yes @authentication_required No @param options [Hash] A customizable set of options. @option options [Float] :lat The latitude to search around. 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. @option options [Float] :long The longitude to search around. The valid range 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. @option options [String] :accuracy (‘0m’) A hint on the "region" in which to search. If a number, then this is a radius in meters, but it can also take a string that is suffixed with ft to specify feet. If coming from a device, in practice, this value is whatever accuracy the device has measuring its location (whether it be coming from a GPS, WiFi triangulation, etc.). @option options [String] :granularity (‘neighborhood’) This is the minimal granularity of place types to return and must be one of: ‘poi’, ‘neighborhood’, ‘city’, ‘admin’ or ‘country’. @option options [Integer] :max_results A hint as to the number of results to return. This does not guarantee that the number of results returned will equal max_results, but instead informs how many "nearby" results to return. Ideally, only pass in the number of places you intend to display to the user here. @return [Array<Twitter::Place>] @example Return an array of places within the specified region
Twitter.reverse_geocode(:lat => "37.7821120598956", :long => "-122.400612831116")
Retrieve the data for saved searches owned by the authenticating user
@see dev.twitter.com/docs/api/1/get/saved_searches/show/:id @rate_limited Yes @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Twitter::SavedSearch] The saved searches. @param id [Integer] A Tweet IDs. @param options [Hash] A customizable set of options. @example Retrieve the data for a saved search owned by the authenticating user with the ID 16129012
Twitter.saved_search(16129012)
Creates a saved search for the authenticated user
@see dev.twitter.com/docs/api/1/post/saved_searches/create @rate_limited No @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Twitter::SavedSearch] The created saved search. @param query [String] The query of the search the user would like to save. @param options [Hash] A customizable set of options. @example Create a saved search for the authenticated user with the query "twitter"
Twitter.saved_search_create("twitter")
Destroys saved searches for the authenticated user
@see dev.twitter.com/docs/api/1/post/saved_searches/destroy/:id @note The search specified by ID must be owned by the authenticating user. @rate_limited No @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::SavedSearch>] The deleted saved searches. @overload saved_search_destroy(*ids)
@param ids [Array<Integer>, Set<Integer>] An array of Tweet IDs. @example Destroys a saved search for the authenticated user with the ID 16129012 Twitter.saved_search_destroy(16129012)
@overload saved_search_destroy(*ids, options)
@param ids [Array<Integer>, Set<Integer>] An array of Tweet IDs. @param options [Hash] A customizable set of options.
@rate_limited Yes @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::SavedSearch>] The saved searches. @overload saved_search(options={})
Returns the authenticated user's saved search queries @see https://dev.twitter.com/docs/api/1/get/saved_searches @param options [Hash] A customizable set of options. @example Return the authenticated user's saved search queries Twitter.saved_searches
@overload saved_search(*ids)
Retrieve the data for saved searches owned by the authenticating user @see https://dev.twitter.com/docs/api/1/get/saved_searches/show/:id @param ids [Array<Integer>, Set<Integer>] An array of Tweet IDs. @example Retrieve the data for a saved search owned by the authenticating user with the ID 16129012 Twitter.saved_search(16129012)
@overload saved_search(*ids, options)
Retrieve the data for saved searches owned by the authenticating user @see https://dev.twitter.com/docs/api/1/get/saved_searches/show/:id @param ids [Array<Integer>, Set<Integer>] An array of Tweet IDs. @param options [Hash] A customizable set of options.
Returns tweets that match a specified query.
@see dev.twitter.com/docs/api/1/get/search @see dev.twitter.com/docs/using-search @see dev.twitter.com/docs/history-rest-search-api @note As of April 1st 2010, the Search API provides an option to retrieve "popular tweets" in addition to real-time search results. In an upcoming release, this will become the default and clients that don‘t want to receive popular tweets in their search results will have to explicitly opt-out. See the result_type parameter below for more information. @rate_limited Yes @authentication_required No @param q [String] A search term. @param options [Hash] A customizable set of options. @option options [String] :geocode Returns tweets by users located within a given radius of the given latitude/longitude. The location is preferentially taking from the Geotagging API, but will fall back to their Twitter profile. The parameter value is specified by "latitude,longitude,radius", where radius units must be specified as either "mi" (miles) or "km" (kilometers). Note that you cannot use the near operator via the API to geocode arbitrary locations; however you can use this geocode parameter to search near geocodes directly. @option options [String] :lang Restricts tweets to the given language, given by an ISO 639-1 code. @option options [String] :locale Specify the language of the query you are sending (only ja is currently effective). This is intended for language-specific clients and the default should work in the majority of cases. @option options [Integer] :page The page number (starting at 1) to return, up to a max of roughly 1500 results (based on rpp * page). @option options [String] :result_type Specifies what type of search results you would prefer to receive. Options are "mixed", "recent", and "popular". The current default is "mixed." @option options [Integer] :rpp The number of tweets to return per page, up to a max of 100. @option options [String] :until Optional. Returns tweets generated before the given date. Date should be formatted as YYYY-MM-DD. @option options [Integer] :since_id Returns results with an ID greater than (that is, more recent than) the specified ID. There are limits to the number of Tweets which can be accessed through the API. If the limit of Tweets has occured since the since_id, the since_id will be forced to the oldest ID available. @option options [Integer] :max_id Returns results with an ID less than (that is, older than) or equal to the specified ID. @option options [Boolean, String, Integer] :with_twitter_user_id When set to either true, t or 1, the from_user_id and to_user_id values in the response will map to "official" user IDs which will match those returned by the REST API. @return [Twitter::SearchResults] Return tweets that match a specified query with search metadata @example Returns tweets related to twitter
Twitter.search('twitter')
Updates the authenticating user‘s settings. Or, if no options supplied, returns settings (including current trend, geo and sleep time information) for the authenticating user.
@see dev.twitter.com/docs/api/1/post/account/settings @see dev.twitter.com/docs/api/1/get/account/settings @rate_limited Yes @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Twitter::Settings] @param options [Hash] A customizable set of options. @option options [Integer] :trend_location_woeid The Yahoo! Where On Earth ID to use as the user‘s default trend location. Global information is available by using 1 as the WOEID. The woeid must be one of the locations returned by {dev.twitter.com/docs/api/1/get/trends/available GET trends/available}. @option options [Boolean, String, Integer] :sleep_time_enabled When set to true, ‘t’ or 1, will enable sleep time for the user. Sleep time is the time when push or SMS notifications should not be sent to the user. @option options [Integer] :start_sleep_time The hour that sleep time should begin if it is enabled. The value for this parameter should be provided in {en.wikipedia.org/wiki/ISO_8601 ISO8601} format (i.e. 00-23). The time is considered to be in the same timezone as the user‘s time_zone setting. @option options [Integer] :end_sleep_time The hour that sleep time should end if it is enabled. The value for this parameter should be provided in {en.wikipedia.org/wiki/ISO_8601 ISO8601} format (i.e. 00-23). The time is considered to be in the same timezone as the user‘s time_zone setting. @option options [String] :time_zone The timezone dates and times should be displayed in for the user. The timezone must be one of the {api.rubyonrails.org/classes/ActiveSupport/TimeZone.html Rails TimeZone} names. @option options [String] :lang The language which Twitter should render in for this user. The language must be specified by the appropriate two letter ISO 639-1 representation. Currently supported languages are provided by {dev.twitter.com/docs/api/1/get/help/languages GET help/languages}. @example Return the settings for the authenticating user.
Twitter.settings
Returns a Tweet
@see dev.twitter.com/docs/api/1/get/statuses/show/:id @rate_limited Yes @authentication_required No, unless the author of the Tweet is protected @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Twitter::Tweet] The requested Tweet. @param id [Integer] A Tweet ID. @param options [Hash] A customizable set of options. @option options [Boolean, String, Integer] :trim_user 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. @example Return the Tweet with the ID 25938088801
Twitter.status(25938088801)
Returns activity summary for a Tweet
@note Undocumented @rate_limited Yes @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Twitter::Tweet] The requested Tweet. @param id [Integer] A Tweet ID. @param options [Hash] A customizable set of options. @example Return activity summary for the Tweet with the ID 25938088801
Twitter.status_activity(25938088801)
Destroys the specified Tweets
@see dev.twitter.com/docs/api/1/post/statuses/destroy/:id @note The authenticating user must be the author of the specified Tweets. @rate_limited No @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::Tweet>] The deleted Tweets. @overload status_destroy(*ids)
@param ids [Array<Integer>, Set<Integer>] An array of Tweet IDs. @example Destroy the Tweet with the ID 25938088801 Twitter.status_destroy(25938088801)
@overload status_destroy(*ids, options)
@param ids [Array<Integer>, Set<Integer>] An array of Tweet IDs. @param options [Hash] A customizable set of options. @option options [Boolean, String, Integer] :trim_user 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 Tweets
@see dev.twitter.com/docs/api/1/get/statuses/show/:id @rate_limited Yes @authentication_required No, unless the author of the Tweet is protected @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::Tweet>] The requested Tweets. @overload statuses(*ids)
@param ids [Array<Integer>, Set<Integer>] An array of Tweet IDs. @example Return the Tweet with the ID 25938088801 Twitter.statuses(25938088801)
@overload statuses(*ids, options)
@param ids [Array<Integer>, Set<Integer>] An array of Tweet IDs. @param options [Hash] A customizable set of options. @option options [Boolean, String, Integer] :trim_user 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 activity summary for Tweets
@note Undocumented @rate_limited Yes @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::Tweet>] The requested Tweets. @overload statuses_activity(*ids)
@param ids [Array<Integer>, Set<Integer>] An array of Tweet IDs. @example Return activity summary for the Tweet with the ID 25938088801 Twitter.statuses_activity(25938088801)
@overload statuses_activity(*ids, options)
@param ids [Array<Integer>, Set<Integer>] An array of Tweet IDs. @param options [Hash] A customizable set of options.
List the lists the specified user follows
@see dev.twitter.com/docs/api/1/get/lists/subscriptions @rate_limited Yes @authentication_required Supported @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Twitter::Cursor] @overload subscriptions(options={})
@param options [Hash] A customizable set of options. @option options [Integer] :cursor (-1) Breaks the results into pages. Provide values as returned in the response objects's next_cursor and previous_cursor attributes to page back and forth in the list. @example List the lists the authenticated user follows Twitter.subscriptions
@overload subscriptions(user, options={})
@param user [Integer, String, Twitter::User] A Twitter user ID, screen name, or object. @param options [Hash] A customizable set of options. @option options [Integer] :cursor (-1) Breaks the results into pages. Provide values as returned in the response objects's next_cursor and previous_cursor attributes to page back and forth in the list. @example List the lists that @sferik follows Twitter.subscriptions('sferik') Twitter.subscriptions(7505382)
Access the users in a given category of the Twitter suggested user list and return their most recent Tweet if they are not a protected user
@see dev.twitter.com/docs/api/1/get/users/suggestions/:slug/members @rate_limited Yes @authentication_required No @param slug [String] The short name of list or a category. @param options [Hash] A customizable set of options. @return [Array<Twitter::User>] @example Return the users in the Art & Design category and their most recent Tweet if they are not a protected user
Twitter.suggest_users("art-design")
@return [Array<Twitter::Suggestion>] @rate_limited Yes @authentication_required No @overload suggestions(options={})
Returns the list of suggested user categories @see https://dev.twitter.com/docs/api/1/get/users/suggestions @param options [Hash] A customizable set of options. @example Return the list of suggested user categories Twitter.suggestions
@overload suggestions(slug, options={})
Returns the users in a given category @see https://dev.twitter.com/docs/api/1/get/users/suggestions/:slug @param slug [String] The short name of list or a category. @param options [Hash] A customizable set of options. @example Return the users in the Art & Design category Twitter.suggestions("art-design")
Returns {twitter.com/tos Twitter‘s Terms of Service}
@see dev.twitter.com/docs/api/1/get/legal/tos @rate_limited Yes @authentication_required No @return [String] @example Return {twitter.com/tos Twitter‘s Terms of Service}
Twitter.tos
Returns the locations that Twitter has trending topic information for
@see dev.twitter.com/docs/api/1/get/trends/available @rate_limited Yes @authentication_required No @param options [Hash] A customizable set of options. @option options [Float] :lat If provided with a :long option the available trend locations will be sorted by distance, nearest to furthest, to the co-ordinate pair. The valid ranges for latitude are -90.0 to +90.0 (North is positive) inclusive. @option options [Float] :long If provided with a :lat option the available trend locations will be sorted by distance, nearest to furthest, to the co-ordinate pair. The valid ranges for longitude are -180.0 to +180.0 (East is positive) inclusive. @return [Array<Twitter::Place>] @example Return the locations that Twitter has trending topic information for
Twitter.trend_locations
Returns the top 20 trending topics for each hour in a given day
@see dev.twitter.com/docs/api/1/get/trends/daily @rate_limited Yes @authentication_required No @param date [Date] The start date for the report. A 404 error will be thrown if the date is older than the available search index (7-10 days). Dates in the future will be forced to the current date. @param options [Hash] A customizable set of options. @option options [String] :exclude Setting this equal to ‘hashtags’ will remove all hashtags from the trends list. @return [Hash] @example Return the top 20 trending topics for each hour of October 24, 2010
Twitter.trends_daily(Date.parse("2010-10-24"))
Returns the top 30 trending topics for each day in a given week
@see dev.twitter.com/docs/api/1/get/trends/weekly @rate_limited Yes @authentication_required No @param date [Date] The start date for the report. A 404 error will be thrown if the date is older than the available search index (7-10 days). Dates in the future will be forced to the current date. @param options [Hash] A customizable set of options. @option options [String] :exclude Setting this equal to ‘hashtags’ will remove all hashtags from the trends list. @return [Hash] @example Return the top ten topics that are currently trending on Twitter
Twitter.trends_weekly(Date.parse("2010-10-24"))
Un-blocks the users specified by the authenticating user
@see dev.twitter.com/docs/api/1/post/blocks/destroy @rate_limited No @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::User>] The un-blocked users. @overload unblock(*users)
@param users [Array<Integer, String, Twitter::User>, Set<Integer, String, Twitter::User>] An array of Twitter user IDs, screen names, or objects. @example Un-block @sferik as the authenticating user Twitter.unblock('sferik') Twitter.unblock(7505382) # Same as above
@overload unblock(*users, options)
@param users [Array<Integer, String, Twitter::User>, Set<Integer, String, Twitter::User>] An array of Twitter user IDs, screen names, or objects. @param options [Hash] A customizable set of options.
Un-favorites the specified Tweets as the authenticating user
@see dev.twitter.com/docs/api/1/post/favorites/destroy/:id @rate_limited No @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::Tweet>] The un-favorited Tweets. @overload unfavorite(*ids)
@param ids [Array<Integer>, Set<Integer>] An array of Tweet IDs. @example Un-favorite the tweet with the ID 25938088801 Twitter.unfavorite(25938088801)
@overload unfavorite(*ids, options)
@param ids [Array<Integer>, Set<Integer>] An array of Tweet IDs. @param options [Hash] A customizable set of options.
Allows the authenticating user to unfollow the specified users
@see dev.twitter.com/docs/api/1/post/friendships/destroy @rate_limited No @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::User>] The unfollowed users. @overload unfollow(*users)
@param users [Array<Integer, String, Twitter::User>, Set<Integer, String, Twitter::User>] An array of Twitter user IDs, screen names, or objects. @example Unfollow @sferik Twitter.unfollow('sferik')
@param users [Array<Integer, String, Twitter::User>, Set<Integer, String, Twitter::User>] An array of Twitter user IDs, screen names, or objects. @param options [Hash] A customizable set of options.
Updates the authenticating user‘s status
@see dev.twitter.com/docs/api/1/post/statuses/update @note A status update with text identical to the authenticating user‘s current status will be ignored to prevent duplicates. @rate_limited No @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Twitter::Tweet] The created Tweet. @param status [String] The text of your status update, up to 140 characters. @param options [Hash] A customizable set of options. @option options [Integer] :in_reply_to_status_id The ID of an existing status that the update is in reply to. @option options [Float] :lat 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. @option options [Float] :long 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. @option options [String] :place_id A place in the world. These IDs can be retrieved from {Twitter::API::Geo#reverse_geocode}. @option options [String] :display_coordinates Whether or not to put a pin on the exact coordinates a tweet has been sent from. @option options [Boolean, String, Integer] :trim_user 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. @example Update the authenticating user‘s status
Twitter.update("I'm tweeting with @gem!")
Sets which device Twitter delivers updates to for the authenticating user
@see dev.twitter.com/docs/api/1/post/account/update_delivery_device @rate_limited No @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Twitter::User] The authenticated user. @param device [String] Must be one of: ‘sms’, ‘none’. @param options [Hash] A customizable set of options. @example Turn SMS updates on for the authenticating user
Twitter.update_delivery_device('sms')
Sets values that users are able to set under the "Account" tab of their settings page
@see dev.twitter.com/docs/api/1/post/account/update_profile @note Only the options specified will be updated. @rate_limited No @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Twitter::User] The authenticated user. @param options [Hash] A customizable set of options. @option options [String] :name Full name associated with the profile. Maximum of 20 characters. @option options [String] :url URL associated with the profile. Will be prepended with "http://" if not present. Maximum of 100 characters. @option options [String] :location The city or country describing where the user of the account is located. The contents are not normalized or geocoded in any way. Maximum of 30 characters. @option options [String] :description A description of the user owning the account. Maximum of 160 characters. @example Set authenticating user‘s name to Erik Michaels-Ober
Twitter.update_profile(:name => "Erik Michaels-Ober")
Updates the authenticating user‘s profile background image
@see dev.twitter.com/docs/api/1/post/account/update_profile_background_image @rate_limited No @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Twitter::User] The authenticated user. @param image [File, Hash] The background image for the profile. 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 scaled down. @param options [Hash] A customizable set of options. @option options [Boolean] :tile Whether or not to tile the background image. If set to true the background image will be displayed tiled. The image will not be tiled otherwise. @example Update the authenticating user‘s profile background image
Twitter.update_profile_background_image(File.new("we_concept_bg2.png")) Twitter.update_profile_background_image(:io => StringIO.new(pic), :type => 'jpg')
Sets one or more hex values that control the color scheme of the authenticating user‘s profile
@see dev.twitter.com/docs/api/1/post/account/update_profile_colors @rate_limited No @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Twitter::User] The authenticated user. @param options [Hash] A customizable set of options. @option options [String] :profile_background_color Profile background color. @option options [String] :profile_text_color Profile text color. @option options [String] :profile_link_color Profile link color. @option options [String] :profile_sidebar_fill_color Profile sidebar‘s background color. @option options [String] :profile_sidebar_border_color Profile sidebar‘s border color. @example Set authenticating user‘s profile background to black
Twitter.update_profile_colors(:profile_background_color => '000000')
Updates the authenticating user‘s profile image
@see dev.twitter.com/docs/api/1/post/account/update_profile_image @note This method asynchronously processes the uploaded file before updating the user‘s profile image URL. You can either update your local cache the next time you request the user‘s information, or, at least 5 seconds after uploading the image, ask for the updated URL using {Twitter::User#profile_image_url}. @rate_limited No @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Twitter::User] The authenticated user. @param image [File, Hash] The avatar image for the profile. 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. Animated GIFs will be converted to a static GIF of the first frame, removing the animation. @param options [Hash] A customizable set of options. @example Update the authenticating user‘s profile image
Twitter.update_profile_image(File.new("me.jpeg")) Twitter.update_profile_image(:io => StringIO.new(pic), :type => 'jpg')
Updates the authenticating user‘s status with media
@see dev.twitter.com/docs/api/1/post/statuses/update_with_media @note A status update with text/media identical to the authenticating user‘s current status will NOT be ignored @rate_limited No @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Twitter::Tweet] The created Tweet. @param status [String] The text of your status update, up to 140 characters. @param media [File, Hash] A File object with your picture (PNG, JPEG or GIF) @param options [Hash] A customizable set of options. @option options [Integer] :in_reply_to_status_id The ID of an existing Tweet that the update is in reply to. @option options [Float] :lat 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. @option options [Float] :long 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. @option options [String] :place_id A place in the world. These IDs can be retrieved from {Twitter::API::Geo#reverse_geocode}. @option options [String] :display_coordinates Whether or not to put a pin on the exact coordinates a tweet has been sent from. @option options [Boolean, String, Integer] :trim_user 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. @example Update the authenticating user‘s status
Twitter.update_with_media("I'm tweeting with @gem!", File.new('my_awesome_pic.jpeg')) Twitter.update_with_media("I'm tweeting with @gem!", {:io => StringIO.new(pic), :type => 'jpg'})
@see dev.twitter.com/docs/api/1/get/users/show @rate_limited Yes @authentication_required No @return [Twitter::User] The requested user. @overload user(options={})
Returns extended information for the authenticated user @param options [Hash] A customizable set of options. @option options [Boolean, String, Integer] :skip_status Do not include user's Tweets when set to true, 't' or 1. @example Return extended information for the authenticated user Twitter.user
@overload user(user, options={})
Returns extended information for a given user @param user [Integer, String, Twitter::User] A Twitter user ID, screen name, or object. @param options [Hash] A customizable set of options. @example Return extended information for @sferik Twitter.user('sferik') Twitter.user(7505382) # Same as above
Returns true if the specified user exists
@authentication_required No @rate_limited Yes @return [Boolean] true if the user exists, otherwise false. @param user [Integer, String, Twitter::User] A Twitter user ID, screen name, or object. @example Return true if @sferik exists
Twitter.user?('sferik') Twitter.user?(7505382) # Same as above
Returns users that match the given query
@see dev.twitter.com/docs/api/1/get/users/search @rate_limited Yes @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::User>] @param query [String] The search query to run against people search. @param options [Hash] A customizable set of options. @option options [Integer] :per_page The number of people to retrieve. Maxiumum of 20 allowed per page. @option options [Integer] :page Specifies the page of results to retrieve. @example Return users that match "Erik Michaels-Ober"
Twitter.user_search("Erik Michaels-Ober")
Returns the 20 most recent Tweets posted by the specified user
@see dev.twitter.com/docs/api/1/get/statuses/user_timeline @note This method can only return up to 3200 Tweets. @rate_limited Yes @authentication_required No, unless the user whose timeline you‘re trying to view is protected @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::Tweet>] @overload user_timeline(user, options={})
@param user [Integer, String, Twitter::User] A Twitter user ID, screen name, or object. @param options [Hash] A customizable set of options. @option options [Integer] :since_id Returns results with an ID greater than (that is, more recent than) the specified ID. @option options [Integer] :max_id Returns results with an ID less than (that is, older than) or equal to the specified ID. @option options [Integer] :count Specifies the number of records to retrieve. Must be less than or equal to 200. @option options [Boolean, String, Integer] :trim_user 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. @option options [Boolean, String, Integer] :exclude_replies This parameter will prevent replies from appearing in the returned timeline. Using exclude_replies with the count parameter will mean you will receive up-to count tweets - this is because the count parameter retrieves that many tweets before filtering out retweets and replies. @option options [Boolean, String, Integer] :include_rts Specifies that the timeline should include native retweets in addition to regular tweets. Note: If you're using the trim_user parameter in conjunction with include_rts, the retweets will no longer contain a full user object. @option options [Boolean, String, Integer] :include_entities Specifies that each tweet should include an 'entities' node including metadata about the tweet such as: user_mentions, urls, and hashtags. @option options [Boolean] :contributor_details Specifies that the contributors element should be enhanced to include the screen_name of the contributor. @example Return the 20 most recent Tweets posted by @sferik Twitter.user_timeline('sferik')
Returns extended information for up to 100 users
@see dev.twitter.com/docs/api/1/get/users/lookup @rate_limited Yes @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Array<Twitter::User>] The requested users. @overload users(*users)
@param users [Array<Integer, String, Twitter::User>, Set<Integer, String, Twitter::User>] An array of Twitter user IDs, screen names, or objects. @example Return extended information for @sferik and @pengwynn Twitter.users('sferik', 'pengwynn') Twitter.users(7505382, 14100886) # Same as above
@overload users(*users, options)
@param users [Array<Integer, String, Twitter::User>, Set<Integer, String, Twitter::User>] An array of Twitter user IDs, screen names, or objects. @param options [Hash] A customizable set of options.
Returns the requesting user if authentication was successful, otherwise raises {Twitter::Error::Unauthorized}
@see dev.twitter.com/docs/api/1/get/account/verify_credentials @rate_limited Yes @authentication_required Yes @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. @return [Twitter::User] The authenticated user. @param options [Hash] A customizable set of options. @option options [Boolean, String, Integer] :skip_status Do not include user‘s Tweets when set to true, ‘t’ or 1. @example Return the requesting user if authentication was successful
Twitter.verify_credentials