grabzit 3.2.9.1 → 3.2.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/grabzit/client.rb +17 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7f18401e940422d323fd30e901ab055c6e7571d
|
4
|
+
data.tar.gz: bee65c28db146017620ad2eac06c9c0e846a5a25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a7b890444aa5c11f64f14b77228ca84ea0b6ee75a83aee1bfe46689e09e97b7a9c94d91ff4da3e2445583c4de3ccfb60e143b31004bc8e541a2c9001a10b531
|
7
|
+
data.tar.gz: 200e7cbfd18825851e96addc06647d0e6b6b5fb7e683c5bc949234b5c4623c3e575fa9c81b8be80f09ac9ae022b057d729ece1e4d8e73c582d3ef4115c8f4ddc
|
data/lib/grabzit/client.rb
CHANGED
@@ -249,16 +249,27 @@ module GrabzIt
|
|
249
249
|
|
250
250
|
sig = encode(@request.options()._getSignatureString(GrabzIt::Utility.nil_check(@applicationSecret), callBackURL, @request.getTargetUrl()))
|
251
251
|
|
252
|
-
data =
|
252
|
+
data = take(sig, callBackURL)
|
253
|
+
|
254
|
+
if data == nil || data == ""
|
255
|
+
data = take(sig, callBackURL)
|
256
|
+
end
|
253
257
|
|
254
|
-
if
|
255
|
-
|
256
|
-
else
|
257
|
-
data = post(@request.url(), URI.encode_www_form(@request.options()._getParameters(@applicationKey, sig, callBackURL, "html", CGI.escape(@request.data()))))
|
258
|
+
if data == nil || data == ""
|
259
|
+
raise GrabzItException.new("An unknown network error occurred, please try calling this method again.", GrabzItException::NETWORK_GENERAL_ERROR)
|
258
260
|
end
|
259
261
|
|
260
262
|
return get_result_value(data, "ID")
|
261
|
-
end
|
263
|
+
end
|
264
|
+
|
265
|
+
private
|
266
|
+
def take(sig, callBackURL)
|
267
|
+
if !@request.isPost()
|
268
|
+
return get(@request.url() + "?" + URI.encode_www_form(@request.options()._getParameters(@applicationKey, sig, callBackURL, "url", @request.data())))
|
269
|
+
end
|
270
|
+
|
271
|
+
return post(@request.url(), URI.encode_www_form(@request.options()._getParameters(@applicationKey, sig, callBackURL, "html", CGI.escape(@request.data()))))
|
272
|
+
end
|
262
273
|
|
263
274
|
# Calls the GrabzIt web service to take the screenshot and saves it to the target path provided. if no target path is provided
|
264
275
|
# it returns the screenshot byte data.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grabzit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.9.
|
4
|
+
version: 3.2.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GrabzIt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04
|
11
|
+
date: 2018-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|