instagram 1.1.5 → 1.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/.travis.yml +4 -3
- data/lib/instagram/client/subscriptions.rb +2 -2
- data/lib/instagram/configuration.rb +5 -0
- data/lib/instagram/request.rb +7 -7
- data/lib/instagram/response.rb +1 -1
- data/lib/instagram/version.rb +1 -1
- data/spec/instagram/api_spec.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
Y2NkZDhhNWZjZjFmYzVkN2YwYWQ2NDg5M2I1YTU0YTgyZGE3NWM4OQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YzZlNzZiYzViZjU0ZDg0OGZlZTk1NWI3ZjVhZDBlMGQwZjFiZjJkMQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NjhjZGRhM2IyZDVkOTQwYWUzYTFjNzMwOGY0MDEyMDFmZWRlNmVmZjEzZjcx
|
10
|
+
YTRhMzUxNDY0YWExMDE0M2MzMjI5OTY3YjkzMmYyMDFlNzRjZTdkNjQ1NDcw
|
11
|
+
MTRhMjAyNTdjNDY0ODExMjEyYWE2ZjJjNmFlMzVmMDc2NzAzYWI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NDJiODkwN2JhZDQ3ZjQxNWRiZWIzOWVkODUyZWRmMjIyNGVlNTI4NTU5OTFl
|
14
|
+
ZmQ3YzQ4NjE2NTk1MWQ5OTdkNTM4OTViYWI2MGZlOWExM2JmNDdiNjg4YjEx
|
15
|
+
ZmQ0OGE5NDAwM2M3Nzg0M2NmZjNhNDdmYTI4YTU5YWM2ZWU1MWM=
|
data/.travis.yml
CHANGED
@@ -63,7 +63,7 @@ module Instagram
|
|
63
63
|
o[:callback_url] = callback_url unless callback_url.nil?
|
64
64
|
o[:aspect] = aspect || o[:aspect] || "media"
|
65
65
|
}
|
66
|
-
response = post("subscriptions", options.merge(:client_secret => client_secret))
|
66
|
+
response = post("subscriptions", options.merge(:client_secret => client_secret), signature=true)
|
67
67
|
response
|
68
68
|
end
|
69
69
|
|
@@ -92,7 +92,7 @@ module Instagram
|
|
92
92
|
options = args.last.is_a?(Hash) ? args.pop : {}
|
93
93
|
subscription_id = args.first
|
94
94
|
options.merge!(:id => subscription_id) if subscription_id
|
95
|
-
response = delete("subscriptions", options.merge(:client_secret => client_secret))
|
95
|
+
response = delete("subscriptions", options.merge(:client_secret => client_secret), signature=true)
|
96
96
|
response
|
97
97
|
end
|
98
98
|
|
@@ -20,6 +20,7 @@ module Instagram
|
|
20
20
|
:user_agent,
|
21
21
|
:no_response_wrapper,
|
22
22
|
:loud_logger,
|
23
|
+
:sign_requests,
|
23
24
|
].freeze
|
24
25
|
|
25
26
|
# By default, don't set a user access token
|
@@ -76,6 +77,9 @@ module Instagram
|
|
76
77
|
# By default, don't turn on loud logging
|
77
78
|
DEFAULT_LOUD_LOGGER = nil
|
78
79
|
|
80
|
+
# By default, requests are not signed
|
81
|
+
DEFAULT_SIGN_REQUESTS = false
|
82
|
+
|
79
83
|
# @private
|
80
84
|
attr_accessor *VALID_OPTIONS_KEYS
|
81
85
|
|
@@ -112,6 +116,7 @@ module Instagram
|
|
112
116
|
self.user_agent = DEFAULT_USER_AGENT
|
113
117
|
self.no_response_wrapper= DEFAULT_NO_RESPONSE_WRAPPER
|
114
118
|
self.loud_logger = DEFAULT_LOUD_LOGGER
|
119
|
+
self.sign_requests = DEFAULT_SIGN_REQUESTS
|
115
120
|
end
|
116
121
|
end
|
117
122
|
end
|
data/lib/instagram/request.rb
CHANGED
@@ -5,29 +5,29 @@ module Instagram
|
|
5
5
|
# Defines HTTP request methods
|
6
6
|
module Request
|
7
7
|
# Perform an HTTP GET request
|
8
|
-
def get(path, options={}, signature=false, raw=false, unformatted=false, no_response_wrapper=no_response_wrapper(), signed=
|
8
|
+
def get(path, options={}, signature=false, raw=false, unformatted=false, no_response_wrapper=no_response_wrapper(), signed=sign_requests)
|
9
9
|
request(:get, path, options, signature, raw, unformatted, no_response_wrapper, signed)
|
10
10
|
end
|
11
11
|
|
12
12
|
# Perform an HTTP POST request
|
13
|
-
def post(path, options={}, signature=false, raw=false, unformatted=false, no_response_wrapper=no_response_wrapper(), signed=
|
13
|
+
def post(path, options={}, signature=false, raw=false, unformatted=false, no_response_wrapper=no_response_wrapper(), signed=sign_requests)
|
14
14
|
request(:post, path, options, signature, raw, unformatted, no_response_wrapper, signed)
|
15
15
|
end
|
16
16
|
|
17
17
|
# Perform an HTTP PUT request
|
18
|
-
def put(path, options={}, signature=false, raw=false, unformatted=false, no_response_wrapper=no_response_wrapper(), signed=
|
18
|
+
def put(path, options={}, signature=false, raw=false, unformatted=false, no_response_wrapper=no_response_wrapper(), signed=sign_requests)
|
19
19
|
request(:put, path, options, signature, raw, unformatted, no_response_wrapper, signed)
|
20
20
|
end
|
21
21
|
|
22
22
|
# Perform an HTTP DELETE request
|
23
|
-
def delete(path, options={}, signature=false, raw=false, unformatted=false, no_response_wrapper=no_response_wrapper(), signed=
|
23
|
+
def delete(path, options={}, signature=false, raw=false, unformatted=false, no_response_wrapper=no_response_wrapper(), signed=sign_requests)
|
24
24
|
request(:delete, path, options, signature, raw, unformatted, no_response_wrapper, signed)
|
25
25
|
end
|
26
26
|
|
27
27
|
private
|
28
28
|
|
29
29
|
# Perform an HTTP request
|
30
|
-
def request(method, path, options, signature=false, raw=false, unformatted=false, no_response_wrapper=false, signed=
|
30
|
+
def request(method, path, options, signature=false, raw=false, unformatted=false, no_response_wrapper=false, signed=sign_requests)
|
31
31
|
response = connection(raw).send(method) do |request|
|
32
32
|
path = formatted_path(path) unless unformatted
|
33
33
|
|
@@ -44,9 +44,9 @@ module Instagram
|
|
44
44
|
|
45
45
|
case method
|
46
46
|
when :get, :delete
|
47
|
-
request.url(path, options)
|
47
|
+
request.url(URI.encode(path), options)
|
48
48
|
when :post, :put
|
49
|
-
request.path = path
|
49
|
+
request.path = URI.encode(path)
|
50
50
|
request.body = options unless options.empty?
|
51
51
|
end
|
52
52
|
if signature && client_ips != nil
|
data/lib/instagram/response.rb
CHANGED
data/lib/instagram/version.rb
CHANGED
data/spec/instagram/api_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: instagram
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shayne Sweeney
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|