Class: Instagram::Client
- Inherits:
-
API
- Object
- API
- Instagram::Client
- Includes:
- Comments, Embedding, Geographies, Likes, Locations, Media, Subscriptions, Tags, Users
- Defined in:
- lib/instagram/client.rb,
lib/instagram/client/tags.rb,
lib/instagram/client/likes.rb,
lib/instagram/client/media.rb,
lib/instagram/client/users.rb,
lib/instagram/client/utils.rb,
lib/instagram/client/comments.rb,
lib/instagram/client/embedding.rb,
lib/instagram/client/locations.rb,
lib/instagram/client/geographies.rb,
lib/instagram/client/subscriptions.rb
Overview
All methods have been separated into modules and follow the same grouping used in http://instagram.com/developer/
Wrapper for the Instagram REST API
Defined Under Namespace
Modules: Comments, Embedding, Geographies, Likes, Locations, Media, Subscriptions, Tags, Users
Instance Method Summary collapse
-
#approve_user(id, options = {}) ⇒ Hashie::Mash
Approve a relationship request between the current user and the target user.
-
#unfollow_user(id, options = {}) ⇒ Hashie::Mash
Block a relationship between the current user and the target user.
-
#deny_user(id, options = {}) ⇒ Hashie::Mash
Deny a relationship request between the current user and the target user.
-
#follow_user(id, options = {}) ⇒ Hashie::Mash
Create a follows relationship between the current user and the target user.
-
#unblock_user(id, options = {}) ⇒ Hashie::Mash
Remove a relationship block between the current user and the target user.
-
#unfollow_user(id, options = {}) ⇒ Hashie::Mash
Destroy a follows relationship between the current user and the target user.
-
#user_followed_by(*args) ⇒ Object
Returns a list of users whom a given user is followed by.
-
#user_liked_media(options = {}) ⇒ Hashie::Mash
Returns a list of media items liked by the current user.
-
#user_media_feed(options = {}) ⇒ Hashie::Mash
Returns most recent media items from the currently authorized user's feed.
-
#user_recent_media(*args) ⇒ Object
Returns a list of recent media items for a given user.
-
#user_relationship(id, options = {}) ⇒ Hashie::Mash
Returns information about the current user's relationship (follow/following/etc) to another user.
-
#user_requested_by ⇒ Object
Returns a list of users who have requested the currently authorized user's permission to follow.
Methods included from Embedding
Methods included from Subscriptions
#create_subscription, #delete_subscription, #meet_challenge, #process_subscription, #subscriptions, #validate_update
Methods included from Likes
#like_media, #media_likes, #unlike_media
Methods included from Comments
#create_media_comment, #delete_media_comment, #media_comments
Methods included from Tags
#tag, #tag_recent_media, #tag_search
Methods included from Geographies
Methods included from Locations
#location, #location_recent_media, #location_search
Methods included from Media
#media_item, #media_popular, #media_search
Methods included from Users
#user, #user_follows, #user_search
Methods included from OAuth
#authorize_url, #get_access_token
Methods included from Request
Instance Method Details
#approve_user(id, options = {}) ⇒ Hashie::Mash
Approve a relationship request between the current user and the target user
286 287 288 289 290 |
# File 'lib/instagram/client/users.rb', line 286 def approve_user(id, ={}) ["action"] = "approve" response = post("users/#{id}/relationship", ) response end |
#unfollow_user(id, options = {}) ⇒ Hashie::Mash
Block a relationship between the current user and the target user
250 251 252 253 254 |
# File 'lib/instagram/client/users.rb', line 250 def block_user(id, ={}) ["action"] = "block" response = post("users/#{id}/relationship", ) response end |
#deny_user(id, options = {}) ⇒ Hashie::Mash
Deny a relationship request between the current user and the target user
304 305 306 307 308 |
# File 'lib/instagram/client/users.rb', line 304 def deny_user(id, ={}) ["action"] = "deny" response = post("users/#{id}/relationship", ) response end |
#follow_user(id, options = {}) ⇒ Hashie::Mash
Create a follows relationship between the current user and the target user
214 215 216 217 218 |
# File 'lib/instagram/client/users.rb', line 214 def follow_user(id, ={}) ["action"] = "follow" response = post("users/#{id}/relationship", ) response end |
#unblock_user(id, options = {}) ⇒ Hashie::Mash
Remove a relationship block between the current user and the target user
268 269 270 271 272 |
# File 'lib/instagram/client/users.rb', line 268 def unblock_user(id, ={}) ["action"] = "unblock" response = post("users/#{id}/relationship", ) response end |
#unfollow_user(id, options = {}) ⇒ Hashie::Mash
Destroy a follows relationship between the current user and the target user
232 233 234 235 236 |
# File 'lib/instagram/client/users.rb', line 232 def unfollow_user(id, ={}) ["action"] = "unfollow" response = post("users/#{id}/relationship", ) response end |
#user_followed_by(id = nil, options = {}) ⇒ Hashie::Mash #user_followed_by(id = nil, options = {}) ⇒ Hashie::Mash
Returns a list of users whom a given user is followed by
92 93 94 95 96 97 |
# File 'lib/instagram/client/users.rb', line 92 def user_followed_by(*args) = args.last.is_a?(Hash) ? args.pop : {} id = args.first || "self" response = get("users/#{id}/followed-by", ) response end |
#user_liked_media(options = {}) ⇒ Hashie::Mash
Returns a list of media items liked by the current user
180 181 182 183 |
# File 'lib/instagram/client/users.rb', line 180 def user_liked_media(={}) response = get("users/self/media/liked", ) response end |
#user_media_feed(options = {}) ⇒ Hashie::Mash
Returns most recent media items from the currently authorized user's feed
133 134 135 136 137 |
# File 'lib/instagram/client/users.rb', line 133 def user_media_feed(*args) = args.first.is_a?(Hash) ? args.pop : {} response = get('users/self/feed', ) response end |
#user_recent_media(options = {}) ⇒ Hashie::Mash #user_recent_media(id = nil, options = {}) ⇒ Hashie::Mash
Returns a list of recent media items for a given user
160 161 162 163 164 165 |
# File 'lib/instagram/client/users.rb', line 160 def user_recent_media(*args) = args.last.is_a?(Hash) ? args.pop : {} id = args.first || "self" response = get("users/#{id}/media/recent", ) response end |
#user_relationship(id, options = {}) ⇒ Hashie::Mash
Returns information about the current user's relationship (follow/following/etc) to another user
197 198 199 200 |
# File 'lib/instagram/client/users.rb', line 197 def user_relationship(id, ={}) response = get("users/#{id}/relationship", ) response end |
#user_requested_by ⇒ Hashie::Mash #user_requested_by ⇒ Hashie::Mash
Returns a list of users who have requested the currently authorized user's permission to follow
114 115 116 117 |
# File 'lib/instagram/client/users.rb', line 114 def user_requested_by() response = get("users/self/requested-by") response end |