instagram 0.11.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/.gitignore +1 -0
- data/LICENSE.md +27 -17
- data/PATENTS.md +23 -0
- data/README.md +129 -46
- data/instagram.gemspec +18 -6
- data/lib/faraday/raise_http_exception.rb +4 -0
- data/lib/instagram/api.rb +8 -0
- data/lib/instagram/client.rb +2 -2
- data/lib/instagram/client/comments.rb +3 -3
- data/lib/instagram/client/embedding.rb +17 -0
- data/lib/instagram/client/likes.rb +3 -3
- data/lib/instagram/client/locations.rb +6 -3
- data/lib/instagram/client/media.rb +3 -3
- data/lib/instagram/client/subscriptions.rb +57 -2
- data/lib/instagram/client/tags.rb +6 -6
- data/lib/instagram/client/users.rb +15 -15
- data/lib/instagram/client/utils.rb +13 -0
- data/lib/instagram/configuration.rb +37 -25
- data/lib/instagram/connection.rb +1 -1
- data/lib/instagram/error.rb +6 -0
- data/lib/instagram/oauth.rb +2 -0
- data/lib/instagram/request.rb +4 -4
- data/lib/instagram/version.rb +1 -1
- data/spec/faraday/response_spec.rb +30 -0
- data/spec/instagram/api_spec.rb +97 -21
- data/spec/instagram/client/locations_spec.rb +24 -0
- data/spec/instagram/client/subscriptions_spec.rb +8 -5
- data/spec/instagram/client/tags_spec.rb +1 -0
- data/spec/instagram/client_spec.rb +1 -1
- metadata +23 -9
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MzgxZDBjNmRmOTY4Y2Q4NjI0YzE0NDc1NTQ2ZThmYzQ1ZDgxMzA2MA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZmM0YmZhNjVjYzVmMGE0NTVlMTQyMmNjNDk3ZDhlMTBiZjEyY2YzMw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NmIwZDYxY2NiZTM1ODhjZDRiMGQzODYzNDNhMzVjNWZhYjgwYjkwYTE0MjQy
|
10
|
+
YTVlYmFhMzNjMWQ3NzBiMjdmZWNjMTQwYzliY2Y0ZDA2NjRhZjhjMTI2OTQz
|
11
|
+
ZWI4MTY3MmQ3MTgzZTNjMGM4OWQ3YzMwZjE0YTllZTRjODJiMTE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZDk2Y2ZhZjNmNDM3ZDJjNDVmMGVlOGUzMjUwM2JiOGUyMDJhODhjNzFlZWRi
|
14
|
+
M2U0NTAzNmY1Y2E2ZTgyOGZhYmFhNzIyNDc5MzhhYjc1N2EyY2IxZmYzN2Qx
|
15
|
+
YTY0OTkyOWMyNmY0OGQ3MWZlNzVkNjIyOGMyNjJlZmViY2I3NDk=
|
data/.gitignore
CHANGED
data/LICENSE.md
CHANGED
@@ -1,20 +1,30 @@
|
|
1
|
-
|
1
|
+
BSD License
|
2
2
|
|
3
|
-
|
4
|
-
a copy of this software and associated documentation files (the
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
the following conditions:
|
3
|
+
For Ruby Instagram Gem software
|
10
4
|
|
11
|
-
|
12
|
-
included in all copies or substantial portions of the Software.
|
5
|
+
Copyright (c) 2014, Facebook, Inc. All rights reserved.
|
13
6
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
7
|
+
Redistribution and use in source and binary forms, with or without modification,
|
8
|
+
are permitted provided that the following conditions are met:
|
9
|
+
|
10
|
+
* Redistributions of source code must retain the above copyright notice, this
|
11
|
+
list of conditions and the following disclaimer.
|
12
|
+
|
13
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
14
|
+
this list of conditions and the following disclaimer in the documentation
|
15
|
+
and/or other materials provided with the distribution.
|
16
|
+
|
17
|
+
* Neither the name Facebook nor the names of its contributors may be used to
|
18
|
+
endorse or promote products derived from this software without specific
|
19
|
+
prior written permission.
|
20
|
+
|
21
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
22
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
23
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
24
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
25
|
+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
26
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
27
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
28
|
+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
29
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
30
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/PATENTS.md
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
Additional Grant of Patent Rights
|
2
|
+
|
3
|
+
"Software" means the Instagram Ruby Gem software distributed by Facebook, Inc.
|
4
|
+
|
5
|
+
Facebook hereby grants you a perpetual, worldwide, royalty-free, non-exclusive,
|
6
|
+
irrevocable (subject to the termination provision below) license under any
|
7
|
+
rights in any patent claims owned by Facebook, to make, have made, use, sell,
|
8
|
+
offer to sell, import, and otherwise transfer the Software. For avoidance of
|
9
|
+
doubt, no license is granted under Facebook’s rights in any patent claims that
|
10
|
+
are infringed by (i) modifications to the Software made by you or a third party,
|
11
|
+
or (ii) the Software in combination with any software or other technology
|
12
|
+
provided by you or a third party.
|
13
|
+
|
14
|
+
The license granted hereunder will terminate, automatically and without notice,
|
15
|
+
for anyone that makes any claim (including by filing any lawsuit, assertion or
|
16
|
+
other action) alleging (a) direct, indirect, or contributory infringement or
|
17
|
+
inducement to infringe any patent: (i) by Facebook or any of its subsidiaries or
|
18
|
+
affiliates, whether or not such claim is related to the Software, (ii) by any
|
19
|
+
party if such claim arises in whole or in part from any software, product or
|
20
|
+
service of Facebook or any of its subsidiaries or affiliates, whether or not
|
21
|
+
such claim is related to the Software, or (iii) by any party relating to the
|
22
|
+
Software; or (b) that any right in any patent claim of Facebook is invalid or
|
23
|
+
unenforceable.
|
data/README.md
CHANGED
@@ -7,16 +7,19 @@ Installation
|
|
7
7
|
------------
|
8
8
|
gem install instagram
|
9
9
|
|
10
|
+
Instagram REST and Search APIs
|
11
|
+
------------------------------
|
12
|
+
Our [developer site](http://instagram.com/developer) documents all the Instagram REST and Search APIs.
|
10
13
|
|
11
|
-
|
14
|
+
|
15
|
+
Blog
|
12
16
|
----------------------------
|
13
|
-
You
|
14
|
-
updates, and news about the Instagram gem.
|
17
|
+
The [Developer Blog] features news and important announcements about the Instagram Platform. You will also find tutorials and best practices to help you build great platform integrations. Make sure to subscribe to the RSS feed not to miss out on new posts: [http://developers.instagram.com](http://developers.instagram.com).
|
15
18
|
|
16
19
|
|
17
|
-
|
20
|
+
Community
|
18
21
|
----------------------
|
19
|
-
|
22
|
+
The [Stack Overflow community](http://stackoverflow.com/questions/tagged/instagram/) is a great place to ask API related questions or if you need help with your code. Make sure to tag your questions with the Instagram tag to get fast answers from other fellow developers and members of the Instagram team.
|
20
23
|
|
21
24
|
|
22
25
|
Does your project or organization use this gem?
|
@@ -36,8 +39,8 @@ enable :sessions
|
|
36
39
|
CALLBACK_URL = "http://localhost:4567/oauth/callback"
|
37
40
|
|
38
41
|
Instagram.configure do |config|
|
39
|
-
config.client_id = "YOUR_CLIENT_ID"
|
40
|
-
config.client_secret = "YOUR_CLIENT_SECRET"
|
42
|
+
config.client_id = "YOUR_CLIENT_ID" #"86893d683a2145fda781f77e48b9aa4a"
|
43
|
+
config.client_secret = "YOUR_CLIENT_SECRET" #"6fea5cbc10214966b131c43563fd4664"
|
41
44
|
end
|
42
45
|
|
43
46
|
get "/" do
|
@@ -51,65 +54,132 @@ end
|
|
51
54
|
get "/oauth/callback" do
|
52
55
|
response = Instagram.get_access_token(params[:code], :redirect_uri => CALLBACK_URL)
|
53
56
|
session[:access_token] = response.access_token
|
54
|
-
redirect "/
|
57
|
+
redirect "/nav"
|
58
|
+
end
|
59
|
+
|
60
|
+
get "/nav" do
|
61
|
+
html =
|
62
|
+
"""
|
63
|
+
<h1>Ruby Instagram Gem Sample Application</h1>
|
64
|
+
<ol>
|
65
|
+
<li><a href='/user_recent_media'>User Recent Media</a> Calls user_recent_media - Get a list of a user's most recent media</li>
|
66
|
+
<li><a href='/user_media_feed'>User Media Feed</a> Calls user_media_feed - Get the currently authenticated user's media feed uses pagination</li>
|
67
|
+
<li><a href='/location_recent_media'>Location Recent Media</a> Calls location_recent_media - Get a list of recent media at a given location, in this case, the Instagram office</li>
|
68
|
+
<li><a href='/media_search'>Media Search</a> Calls media_search - Get a list of media close to a given latitude and longitude</li>
|
69
|
+
<li><a href='/media_popular'>Popular Media</a> Calls media_popular - Get a list of the overall most popular media items</li>
|
70
|
+
<li><a href='/user_search'>User Search</a> Calls user_search - Search for users on instagram, by name or username</li>
|
71
|
+
<li><a href='/location_search'>Location Search</a> Calls location_search - Search for a location by lat/lng</li>
|
72
|
+
<li><a href='/location_search_4square'>Location Search - 4Square</a> Calls location_search - Search for a location by Fousquare ID (v2)</li>
|
73
|
+
<li><a href='/tags'>Tags</a>Search for tags, view tag info and get media by tag</li>
|
74
|
+
<li><a href='/limits'>View Rate Limit and Remaining API calls</a>View remaining and ratelimit info.</li>
|
75
|
+
</ol>
|
76
|
+
"""
|
77
|
+
html
|
55
78
|
end
|
56
79
|
|
57
|
-
get "/
|
80
|
+
get "/user_recent_media" do
|
58
81
|
client = Instagram.client(:access_token => session[:access_token])
|
59
82
|
user = client.user
|
60
|
-
|
61
|
-
html = "<h1>#{user.username}'s recent photos</h1>"
|
83
|
+
html = "<h1>#{user.username}'s recent media</h1>"
|
62
84
|
for media_item in client.user_recent_media
|
63
85
|
html << "<img src='#{media_item.images.thumbnail.url}'>"
|
64
86
|
end
|
65
87
|
html
|
66
88
|
end
|
67
|
-
```
|
68
89
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
90
|
+
get "/user_media_feed" do
|
91
|
+
client = Instagram.client(:access_token => session[:access_token])
|
92
|
+
user = client.user
|
93
|
+
html = "<h1>#{user.username}'s media feed</h1>"
|
94
|
+
|
95
|
+
page_1 = client.user_media_feed(777)
|
96
|
+
page_2_max_id = page_1.pagination.next_max_id
|
97
|
+
page_2 = client.user_recent_media(777, :max_id => page_2_max_id ) unless page_2_max_id.nil?
|
98
|
+
html << "<h2>Page 1</h2><br/>"
|
99
|
+
for media_item in page_1
|
100
|
+
html << "<img src='#{media_item.images.thumbnail.url}'>"
|
101
|
+
end
|
102
|
+
html << "<h2>Page 2</h2><br/>"
|
103
|
+
for media_item in page_2
|
104
|
+
html << "<img src='#{media_item.images.thumbnail.url}'>"
|
105
|
+
end
|
106
|
+
html
|
80
107
|
end
|
81
108
|
|
82
|
-
|
83
|
-
|
109
|
+
get "/location_recent_media" do
|
110
|
+
client = Instagram.client(:access_token => session[:access_token])
|
111
|
+
html = "<h1>Media from the Instagram Office</h1>"
|
112
|
+
for media_item in client.location_recent_media(514276)
|
113
|
+
html << "<img src='#{media_item.images.thumbnail.url}'>"
|
114
|
+
end
|
115
|
+
html
|
116
|
+
end
|
84
117
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
118
|
+
get "/media_search" do
|
119
|
+
client = Instagram.client(:access_token => session[:access_token])
|
120
|
+
html = "<h1>Get a list of media close to a given latitude and longitude</h1>"
|
121
|
+
for media_item in client.media_search("37.7808851","-122.3948632")
|
122
|
+
html << "<img src='#{media_item.images.thumbnail.url}'>"
|
123
|
+
end
|
124
|
+
html
|
125
|
+
end
|
89
126
|
|
90
|
-
|
91
|
-
|
127
|
+
get "/media_popular" do
|
128
|
+
client = Instagram.client(:access_token => session[:access_token])
|
129
|
+
html = "<h1>Get a list of the overall most popular media items</h1>"
|
130
|
+
for media_item in client.media_popular
|
131
|
+
html << "<img src='#{media_item.images.thumbnail.url}'>"
|
132
|
+
end
|
133
|
+
html
|
134
|
+
end
|
92
135
|
|
93
|
-
|
94
|
-
|
136
|
+
get "/user_search" do
|
137
|
+
client = Instagram.client(:access_token => session[:access_token])
|
138
|
+
html = "<h1>Search for users on instagram, by name or usernames</h1>"
|
139
|
+
for user in client.user_search("instagram")
|
140
|
+
html << "<li> <img src='#{user.profile_picture}'> #{user.username} #{user.full_name}</li>"
|
141
|
+
end
|
142
|
+
html
|
143
|
+
end
|
95
144
|
|
96
|
-
|
97
|
-
|
145
|
+
get "/location_search" do
|
146
|
+
client = Instagram.client(:access_token => session[:access_token])
|
147
|
+
html = "<h1>Search for a location by lat/lng with a radius of 5000m</h1>"
|
148
|
+
for location in client.location_search("48.858844","2.294351","5000")
|
149
|
+
html << "<li> #{location.name} <a href='https://www.google.com/maps/preview/@#{location.latitude},#{location.longitude},19z'>Map</a></li>"
|
150
|
+
end
|
151
|
+
html
|
152
|
+
end
|
98
153
|
|
99
|
-
|
100
|
-
|
154
|
+
get "/location_search_4square" do
|
155
|
+
client = Instagram.client(:access_token => session[:access_token])
|
156
|
+
html = "<h1>Search for a location by Fousquare ID (v2)</h1>"
|
157
|
+
for location in client.location_search("3fd66200f964a520c5f11ee3")
|
158
|
+
html << "<li> #{location.name} <a href='https://www.google.com/maps/preview/@#{location.latitude},#{location.longitude},19z'>Map</a></li>"
|
159
|
+
end
|
160
|
+
html
|
161
|
+
end
|
101
162
|
|
102
|
-
|
103
|
-
|
163
|
+
get "/tags" do
|
164
|
+
client = Instagram.client(:access_token => session[:access_token])
|
165
|
+
html = "<h1>Search for tags, get tag info and get media by tag</h1>"
|
166
|
+
tags = client.tag_search('cat')
|
167
|
+
html << "<h2>Tag Name = #{tags[0].name}. Media Count = #{tags[0].media_count}. </h2><br/><br/>"
|
168
|
+
for media_item in client.tag_recent_media(tags[0].name)
|
169
|
+
html << "<img src='#{media_item.images.thumbnail.url}'>"
|
170
|
+
end
|
171
|
+
html
|
172
|
+
end
|
104
173
|
|
105
|
-
|
106
|
-
|
174
|
+
get "/limits" do
|
175
|
+
client = Instagram.client(:access_token => session[:access_token])
|
176
|
+
html = "<h1/>View API Rate Limit and calls remaining</h1>"
|
177
|
+
response = client.utils_raw_response
|
178
|
+
html << "Rate Limit = #{response.headers[:x_ratelimit_limit]}. <br/>Calls Remaining = #{response.headers[:x_ratelimit_remaining]}"
|
107
179
|
|
108
|
-
|
109
|
-
|
180
|
+
html
|
181
|
+
end
|
110
182
|
```
|
111
|
-
|
112
|
-
|
113
183
|
|
114
184
|
Contributing
|
115
185
|
------------
|
@@ -137,6 +207,10 @@ bug report, please include a [Gist](http://gist.github.com/) that includes a sta
|
|
137
207
|
details that may be necessary to reproduce the bug, including your gem version, Ruby version, and
|
138
208
|
operating system. Ideally, a bug report should include a pull request with failing specs.
|
139
209
|
|
210
|
+
Instagram has a [bounty program](https://www.facebook.com/whitehat/) for the safe
|
211
|
+
disclosure of security bugs. In those cases, please go through the process
|
212
|
+
outlined on that page and do not file a public issue.
|
213
|
+
|
140
214
|
|
141
215
|
Submitting a Pull Request
|
142
216
|
-------------------------
|
@@ -149,9 +223,18 @@ Submitting a Pull Request
|
|
149
223
|
7. Run <tt>rake spec</tt>. If your changes are not 100% covered, go back to step 6.
|
150
224
|
8. Commit and push your changes.
|
151
225
|
9. Submit a pull request. Please do not include changes to the gemspec, version, or history file. (If you want to create your own version for some reason, please do so in a separate commit.)
|
226
|
+
10. If you haven't already, complete the Contributor License Agreement ("CLA").
|
227
|
+
|
228
|
+
Contributor License Agreement ("CLA")
|
229
|
+
_____________________________________
|
230
|
+
In order to accept your pull request, we need you to submit a CLA. You only need
|
231
|
+
to do this once to work on any of Instagram's or Facebook's open source projects.
|
232
|
+
|
233
|
+
Complete your CLA here: [https://code.facebook.com/cla](https://code.facebook.com/cla)
|
152
234
|
|
153
235
|
|
154
236
|
Copyright
|
155
237
|
---------
|
156
|
-
Copyright (c)
|
238
|
+
Copyright (c) 2014, Facebook, Inc. All rights reserved.
|
239
|
+
By contributing to Instgram Ruby Gem, you agree that your contributions will be licensed under its BSD license.
|
157
240
|
See [LICENSE](https://github.com/Instagram/instagram-ruby-gem/blob/master/LICENSE.md) for details.
|
data/instagram.gemspec
CHANGED
@@ -5,8 +5,8 @@ Gem::Specification.new do |s|
|
|
5
5
|
s.add_development_dependency('rspec', '~> 2.4')
|
6
6
|
s.add_development_dependency('webmock', '~> 1.6')
|
7
7
|
s.add_development_dependency('bluecloth', '~> 2.0.11')
|
8
|
-
s.add_runtime_dependency('faraday', ['>= 0.7', '< 0.
|
9
|
-
s.add_runtime_dependency('faraday_middleware', '
|
8
|
+
s.add_runtime_dependency('faraday', ['>= 0.7', '< 0.10'])
|
9
|
+
s.add_runtime_dependency('faraday_middleware', ['>= 0.8', '< 0.10'])
|
10
10
|
s.add_runtime_dependency('multi_json', '>= 1.0.3', '~> 1.0')
|
11
11
|
s.add_runtime_dependency('hashie', '>= 0.4.0')
|
12
12
|
s.authors = ["Shayne Sweeney"]
|
@@ -14,11 +14,23 @@ Gem::Specification.new do |s|
|
|
14
14
|
s.post_install_message =<<eos
|
15
15
|
********************************************************************************
|
16
16
|
|
17
|
-
|
18
|
-
|
17
|
+
Instagram REST and Search APIs
|
18
|
+
------------------------------
|
19
|
+
Our developer site documents all the Instagram REST and Search APIs.
|
20
|
+
(http://instagram.com/developer)
|
19
21
|
|
20
|
-
|
21
|
-
|
22
|
+
Blog
|
23
|
+
----------------------------
|
24
|
+
The Developer Blog features news and important announcements about the Instagram Platform.
|
25
|
+
You will also find tutorials and best practices to help you build great platform integrations.
|
26
|
+
Make sure to subscribe to the RSS feed so you don't miss out on new posts:
|
27
|
+
(http://developers.instagram.com).
|
28
|
+
|
29
|
+
Community
|
30
|
+
----------------------
|
31
|
+
The Stack Overflow community is a great place to ask API related questions or if you need help with your code.
|
32
|
+
Make sure to tag your questions with the Instagram tag to get fast answers from other fellow developers and members of the Instagram team.
|
33
|
+
(http://stackoverflow.com/questions/tagged/instagram/)
|
22
34
|
|
23
35
|
********************************************************************************
|
24
36
|
eos
|
@@ -13,8 +13,12 @@ module FaradayMiddleware
|
|
13
13
|
raise Instagram::NotFound, error_message_400(response)
|
14
14
|
when 500
|
15
15
|
raise Instagram::InternalServerError, error_message_500(response, "Something is technically wrong.")
|
16
|
+
when 502
|
17
|
+
raise Instagram::BadGateway, error_message_500(response, "The server returned an invalid or incomplete response.")
|
16
18
|
when 503
|
17
19
|
raise Instagram::ServiceUnavailable, error_message_500(response, "Instagram is rate limiting your requests.")
|
20
|
+
when 504
|
21
|
+
raise Instagram::GatewayTimeout, error_message_500(response, "504 Gateway Time-out")
|
18
22
|
end
|
19
23
|
end
|
20
24
|
end
|
data/lib/instagram/api.rb
CHANGED
data/lib/instagram/client.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
module Instagram
|
2
2
|
# Wrapper for the Instagram REST API
|
3
3
|
#
|
4
|
-
# @note All methods have been separated into modules and follow the same grouping used in
|
5
|
-
# @see
|
4
|
+
# @note All methods have been separated into modules and follow the same grouping used in http://instagram.com/developer/
|
5
|
+
# @see http://instagram.com/developer/
|
6
6
|
class Client < API
|
7
7
|
Dir[File.expand_path('../client/*.rb', __FILE__)].each{|f| require f}
|
8
8
|
|
@@ -14,7 +14,7 @@ module Instagram
|
|
14
14
|
#
|
15
15
|
# If getting this data of a protected user, you must be authenticated (and be allowed to see that user).
|
16
16
|
# @rate_limited true
|
17
|
-
# @see
|
17
|
+
# @see http://instagram.com/developer/endpoints/comments/#get_media_comments
|
18
18
|
def media_comments(id, *args)
|
19
19
|
response = get("media/#{id}/comments")
|
20
20
|
response
|
@@ -33,7 +33,7 @@ module Instagram
|
|
33
33
|
#
|
34
34
|
# If getting this data of a protected user, you must be authenticated (and be allowed to see that user).
|
35
35
|
# @rate_limited true
|
36
|
-
# @see
|
36
|
+
# @see http://instagram.com/developer/endpoints/comments/#post_media_comments
|
37
37
|
def create_media_comment(id, text, options={})
|
38
38
|
response = post("media/#{id}/comments", options.merge(:text => text))
|
39
39
|
response
|
@@ -52,7 +52,7 @@ module Instagram
|
|
52
52
|
#
|
53
53
|
# In order to remove a comment, you must be the owner of the comment, the media item, or both.
|
54
54
|
# @rate_limited true
|
55
|
-
# @see
|
55
|
+
# @see http://instagram.com/developer/endpoints/comments/#delete_media_comments
|
56
56
|
def delete_media_comment(media_id, comment_id, options={})
|
57
57
|
response = delete("media/#{media_id}/comments/#{comment_id}", options)
|
58
58
|
response
|