Module | Twitter::Client::Friendship |
In: |
lib/twitter/client/friendship.rb
|
Defines methods related to friendship
Allows the authenticating user to follow the specified user
@see dev.twitter.com/docs/api/1/post/friendships/create @rate_limited No @requires_authentication Yes @response_format `json` @response_format `xml` @param user [Integer, String] A Twitter user ID or screen name. @param options [Hash] A customizable set of options. @option options [Boolean] :follow (false) Enable notifications for the target user. @option options [Boolean, String, Integer] :include_entities Include {dev.twitter.com/docs/tweet-entities Tweet Entities} when set to true, ‘t’ or 1. @return [Hashie::Mash] The followed user. @example Follow @sferik
Twitter.follow("sferik")
Returns detailed information about the relationship between two users
@see dev.twitter.com/docs/api/1/get/friendships/show @rate_limited Yes @requires_authentication No @response_format `json` @response_format `xml` @param options [Hash] A customizable set of options. @option options [Integer] :source_id The ID of the subject user. @option options [String] :source_screen_name The screen_name of the subject user. @option options [Integer] :target_id The ID of the target user. @option options [String] :target_screen_name The screen_name of the target user. @return [Hashie::Mash] @example Return the relationship between @sferik and @pengwynn
Twitter.friendship(:source_screen_name => "sferik", :target_screen_name => "pengwynn") Twitter.friendship(:source_id => 7505382, :target_id => 14100886)
Test for the existence of friendship between two users
@see dev.twitter.com/docs/api/1/get/friendships/exists @note Consider using {Twitter::Client::Friendship#friendship} instead of this method. @rate_limited Yes @requires_authentication No unless user_a or user_b is protected @response_format `json` @response_format `xml` @param user_a [Integer, String] The ID or screen_name of the subject user. @param user_b [Integer, String] The ID or screen_name of the user to test for following. @param options [Hash] A customizable set of options. @return [Boolean] true if user_a follows user_b, otherwise false. @example Return true if @sferik follows @pengwynn
Twitter.friendship?("sferik", "pengwynn")
Test for the existence of friendship between two users
@see dev.twitter.com/docs/api/1/get/friendships/exists @deprecated {Twitter::Client::Friendship#friendship_exists?} is deprecated and will be removed in the next major version. Please use {Twitter::Client::Friendship#friendship?} instead. @rate_limited Yes @requires_authentication No unless user_a or user_b is protected @response_format `json` @response_format `xml` @param user_a [Integer, String] The ID or screen_name of the subject user. @param user_b [Integer, String] The ID or screen_name of the user to test for following. @param options [Hash] A customizable set of options. @return [Boolean] true if user_a follows user_b, otherwise false. @example Return true if @sferik follows @pengwynn
Twitter.friendship_exists?("sferik", "pengwynn")
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 @requires_authentication Yes @response_format `json` @response_format `xml` @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 [Hashie::Mash] @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 @requires_authentication Yes @response_format `json` @response_format `xml` @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 [Hashie::Mash] @example Return an array of numeric IDs for every protected user for whom the authenticating user has a pending follow request
Twitter.friendships_outgoing
Allows the authenticating user to unfollow the specified user
@see dev.twitter.com/docs/api/1/post/friendships/destroy @rate_limited No @requires_authentication Yes @response_format `json` @response_format `xml` @param user [Integer, String] A Twitter user ID or screen name. @param options [Hash] A customizable set of options. @option options [Boolean, String, Integer] :include_entities Include {dev.twitter.com/docs/tweet-entities Tweet Entities} when set to true, ‘t’ or 1. @return [Hashie::Mash] The unfollowed user. @example Unfollow @sferik
Twitter.unfollow("sferik")