grabzit 2.1.2 → 2.1.3

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 +20 -1
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 708b8f2d2fca3c4b093b887d8c645f291f5584dc
4
- data.tar.gz: fff6e757ebc0d1e312291206abb70b1db9bbe302
3
+ metadata.gz: e46954d4956663d54e9e74b16b56779f9a608d05
4
+ data.tar.gz: 92f87a1e2f4fd45ba920157ad47035373762450f
5
5
  SHA512:
6
- metadata.gz: 0d67ea66dfe7440174730062cb18ef75028e0365b5da1ccf63fcdbe3dd0aae4523e35e31ccc238726a8d623a6a4732b4d624d9ac74aaf2661b98310d8ff456de
7
- data.tar.gz: d7d4e1659c3702700d2b253c8e257dca70b7c0913ae43065035d6ec65128de8418df9375b57f8e1f2134a580b9e774d1290a4dee7707cb0cc022cd09d9116efb
6
+ metadata.gz: f34f12ce5d2c01b566e12e6bff84b1d646815aca85df286ec9d92581c71db624d3a550cee2dc46f37d1d557f3b85ad118d5e113039a19ab17d08af1c2904790f
7
+ data.tar.gz: 1e6d7037338e53771e1c885e007efaceaba3d60b55b47d29fc289af76d1a9ffec0a2762f3c7d6fe898e48f5fb48050fec2acb14c65fd33a68c2b3e87981710de
@@ -32,8 +32,9 @@ module GrabzIt
32
32
 
33
33
  @@signaturePartOne;
34
34
  @@signaturePartTwo;
35
+ @@startDelay;
35
36
  @@request;
36
-
37
+
37
38
  # Create a new instance of the Client class in order to access the GrabzIt API.
38
39
  #
39
40
  # @param applicationKey [String] your application key
@@ -61,6 +62,13 @@ module GrabzIt
61
62
  # @param country [String, nil] request the screenshot from different countries: Default = "", UK = "UK", US = "US"
62
63
  # @return [void]
63
64
  def set_image_options(url, customId = nil, browserWidth = nil, browserHeight = nil, width = nil, height = nil, format = nil, delay = nil, targetElement = nil, requestAs = 0, customWaterMarkId = nil, quality = -1, country = nil)
65
+
66
+ if delay == nil
67
+ @@startDelay = 0
68
+ else
69
+ @@startDelay = delay
70
+ end
71
+
64
72
  @@request = WebServicesBaseURL + "takepicture.ashx?key="+CGI.escape(nil_check(@applicationKey))+"&url="+CGI.escape(nil_check(url))+"&width="+nil_int_check(width)+"&height="+nil_int_check(height)+"&format="+CGI.escape(nil_check(format))+"&bwidth="+nil_int_check(browserWidth)+"&bheight="+nil_int_check(browserHeight)+"&customid="+CGI.escape(nil_check(customId))+"&delay="+nil_int_check(delay)+"&target="+CGI.escape(nil_check(targetElement))+"&customwatermarkid="+CGI.escape(nil_check(customWaterMarkId))+"&requestmobileversion="+nil_int_check(requestAs)+"&country="+CGI.escape(nil_check(country))+"&quality="+nil_int_check(quality)+"&callback="
65
73
  @@signaturePartOne = nil_check(@applicationSecret)+"|"+nil_check(url)+"|"
66
74
  @@signaturePartTwo = "|"+nil_check(format)+"|"+nil_int_check(height)+"|"+nil_int_check(width)+"|"+nil_int_check(browserHeight)+"|"+nil_int_check(browserWidth)+"|"+nil_check(customId)+"|"+nil_int_check(delay)+"|"+nil_check(targetElement)+"|"+nil_check(customWaterMarkId)+"|"+nil_int_check(requestAs)+"|"+nil_check(country)+"|"+nil_int_check(quality)
@@ -81,6 +89,8 @@ module GrabzIt
81
89
  # @param country [String, nil] request the screenshot from different countries: Default = "", UK = "UK", US = "US"
82
90
  # @return [void]
83
91
  def set_table_options(url, customId = nil, tableNumberToInclude = 1, format = 'csv', includeHeaderNames = true, includeAllTables = false, targetElement = nil, requestAs = 0, country = nil)
92
+ @@startDelay = 0
93
+
84
94
  @@request = WebServicesBaseURL + "taketable.ashx?key=" + CGI.escape(nil_check(@applicationKey))+"&url="+CGI.escape(url)+"&includeAllTables="+b_to_str(includeAllTables)+"&includeHeaderNames="+b_to_str(includeHeaderNames)+"&format="+CGI.escape(nil_check(format))+"&tableToInclude="+nil_int_check(tableNumberToInclude)+"&customid="+CGI.escape(nil_check(customId))+"&target="+CGI.escape(nil_check(targetElement))+"&requestmobileversion="+nil_int_check(requestAs)+"&country="+CGI.escape(nil_check(country))+"&callback="
85
95
  @@signaturePartOne = nil_check(@applicationSecret)+"|"+nil_check(url)+"|"
86
96
  @@signaturePartTwo = "|"+nil_check(customId)+"|"+nil_int_check(tableNumberToInclude)+"|"+b_to_str(includeAllTables)+"|"+b_to_str(includeHeaderNames)+"|"+nil_check(targetElement)+"|"+nil_check(format)+"|"+nil_int_check(requestAs)+"|"+nil_check(country)
@@ -112,6 +122,12 @@ module GrabzIt
112
122
  def set_pdf_options(url, customId = nil, includeBackground = true, pagesize = 'A4', orientation = 'Portrait', includeLinks = true, includeOutline = false, title = nil, coverURL = nil, marginTop = 10, marginLeft = 10, marginBottom = 10, marginRight = 10, delay = nil, requestAs = 0, customWaterMarkId = nil, quality = -1, country = nil)
113
123
  pagesize = nil_check(pagesize).upcase
114
124
  $orientation = nil_check(orientation).capitalize
125
+
126
+ if delay == nil
127
+ @@startDelay = 0
128
+ else
129
+ @@startDelay = delay
130
+ end
115
131
 
116
132
  @@request = WebServicesBaseURL + "takepdf.ashx?key=" + CGI.escape(nil_check(@applicationKey))+"&url="+CGI.escape(nil_check(url))+"&background="+b_to_str(includeBackground)+"&pagesize="+pagesize+"&orientation="+orientation+"&customid="+CGI.escape(nil_check(customId))+"&customwatermarkid="+CGI.escape(nil_check(customWaterMarkId))+"&includelinks="+b_to_str(includeLinks)+"&includeoutline="+b_to_str(includeOutline)+"&title="+CGI.escape(nil_check(title))+"&coverurl="+CGI.escape(nil_check(coverURL))+"&mleft="+nil_int_check(marginLeft)+"&mright="+nil_int_check(marginRight)+"&mtop="+nil_int_check(marginTop)+"&mbottom="+nil_int_check(marginBottom)+"&delay="+nil_int_check(delay)+"&requestmobileversion="+nil_int_check(requestAs)+"&country="+CGI.escape(nil_check(country))+"&quality="+nil_int_check(quality)+"&callback="
117
133
 
@@ -161,6 +177,9 @@ module GrabzIt
161
177
  if id == nil || id == ""
162
178
  return false
163
179
  end
180
+
181
+ #Wait for it to be possibly ready
182
+ sleep((@@startDelay / 1000) + 3)
164
183
 
165
184
  #Wait for it to be ready.
166
185
  while true do
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: 2.1.2
4
+ version: 2.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - GrabzIt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-10 00:00:00.000000000 Z
11
+ date: 2014-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake