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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/grabzit/client.rb +17 -6
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8583124bf625f9d369b2f1bd895606a0a39749de
4
- data.tar.gz: c6c023b34d3a24dd5c1696bd1e71b6b30acc7cb8
3
+ metadata.gz: d7f18401e940422d323fd30e901ab055c6e7571d
4
+ data.tar.gz: bee65c28db146017620ad2eac06c9c0e846a5a25
5
5
  SHA512:
6
- metadata.gz: 8ce2c8e5f79285caa0b635c91802c7f1d17179885270f78fc0d99cd5a450f9487fba6ba9509926da2908f669b92b40b5f55a318a2a45672c2441bf9c43001791
7
- data.tar.gz: 6ed69f0bda50702c4c05f4cee667273f1d826039a6706157f64f0e8dff0d33c2cdb7b362298408a8e22eaf87f22c0aff7f03faf50220f49845616edef347a9eb
6
+ metadata.gz: 9a7b890444aa5c11f64f14b77228ca84ea0b6ee75a83aee1bfe46689e09e97b7a9c94d91ff4da3e2445583c4de3ccfb60e143b31004bc8e541a2c9001a10b531
7
+ data.tar.gz: 200e7cbfd18825851e96addc06647d0e6b6b5fb7e683c5bc949234b5c4623c3e575fa9c81b8be80f09ac9ae022b057d729ece1e4d8e73c582d3ef4115c8f4ddc
@@ -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 = nil
252
+ data = take(sig, callBackURL)
253
+
254
+ if data == nil || data == ""
255
+ data = take(sig, callBackURL)
256
+ end
253
257
 
254
- if !@request.isPost()
255
- data = get(@request.url() + "?" + URI.encode_www_form(@request.options()._getParameters(@applicationKey, sig, callBackURL, "url", @request.data())))
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.1
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-27 00:00:00.000000000 Z
11
+ date: 2018-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake