grabzit 3.4.5 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/grabzit/client.rb +2 -2
- data/lib/grabzit/docxoptions.rb +16 -1
- data/lib/grabzit/exception.rb +1 -0
- data/lib/grabzit/imageoptions.rb +16 -1
- data/lib/grabzit/pdfoptions.rb +17 -2
- metadata +6 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ee2e4b1cfbe4852f4caef8693d3e615449280c6842de2ec0fb25adadf06bcc96
|
|
4
|
+
data.tar.gz: edc3e07ea3cb78f48a0fd090fa2520829147ac7503ae78870bdb83a179e86def
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5ce530ba3115c87a54343cda7c8d35b8e2a51099b0ca9f39e2411a3612b8e08bd6cedd7cfe53e272a71396711ce22d4387f5312565b674f7a4e3f5a905dceef0
|
|
7
|
+
data.tar.gz: 4d2ab4167a04e2e85dbe69101c5db926e6aff3c45aa2725a6b5127cbc243588000b5619e0ca8d1968511f0a8202e03dd96b9c1df3835d5d097d3df790bdd5221
|
data/lib/grabzit/client.rb
CHANGED
|
@@ -521,7 +521,7 @@ module GrabzIt
|
|
|
521
521
|
|
|
522
522
|
boundary = '--------------------------'+Time.now.to_f.to_s
|
|
523
523
|
|
|
524
|
-
url = @protocol + "://grabz.it/services/addwatermark.ashx"
|
|
524
|
+
url = @protocol + "://api.grabz.it/services/addwatermark.ashx"
|
|
525
525
|
uri = URI.parse(url)
|
|
526
526
|
|
|
527
527
|
file = File.open(path, "rb")
|
|
@@ -725,7 +725,7 @@ module GrabzIt
|
|
|
725
725
|
|
|
726
726
|
private
|
|
727
727
|
def encode(text)
|
|
728
|
-
return Digest::MD5.hexdigest(text.encode('ascii', {:invalid => :replace, :undef => :replace, :replace => '?'}))
|
|
728
|
+
return Digest::MD5.hexdigest(text.encode('ascii', **{:invalid => :replace, :undef => :replace, :replace => '?'}))
|
|
729
729
|
end
|
|
730
730
|
|
|
731
731
|
private
|
data/lib/grabzit/docxoptions.rb
CHANGED
|
@@ -32,6 +32,7 @@ module GrabzIt
|
|
|
32
32
|
@noCookieNotifications = false
|
|
33
33
|
@address = nil
|
|
34
34
|
@password = nil
|
|
35
|
+
@clickElement = nil
|
|
35
36
|
end
|
|
36
37
|
|
|
37
38
|
# @return [Boolean] true if the background images of the web page should be included in the DOCX
|
|
@@ -296,6 +297,19 @@ module GrabzIt
|
|
|
296
297
|
@waitForElement = value
|
|
297
298
|
end
|
|
298
299
|
|
|
300
|
+
# @return [String] get the CSS selector of the HTML element in the web page that must clicked before the capture is performed
|
|
301
|
+
def clickElement
|
|
302
|
+
@clickElement
|
|
303
|
+
end
|
|
304
|
+
|
|
305
|
+
# Set the CSS selector of the HTML element in the web page that must clicked before the capture is performed
|
|
306
|
+
#
|
|
307
|
+
# @param value [String] the element to click
|
|
308
|
+
# @return [void]
|
|
309
|
+
def clickElement=(value)
|
|
310
|
+
@clickElement = value
|
|
311
|
+
end
|
|
312
|
+
|
|
299
313
|
# @return [String] get the ID of a capture that should be merged at the beginning of the new DOCX document
|
|
300
314
|
def mergeId
|
|
301
315
|
@mergeId
|
|
@@ -387,7 +401,7 @@ module GrabzIt
|
|
|
387
401
|
items.push(GrabzIt::Utility.nil_check(url))
|
|
388
402
|
end
|
|
389
403
|
|
|
390
|
-
items.push(GrabzIt::Utility.nil_check(callBackURL),GrabzIt::Utility.nil_check(@customId),GrabzIt::Utility.b_to_str(@includeBackground),@pagesize ,@orientation,GrabzIt::Utility.b_to_str(@includeImages),GrabzIt::Utility.b_to_str(@includeLinks),GrabzIt::Utility.nil_check(@title),GrabzIt::Utility.nil_int_check(@marginTop),GrabzIt::Utility.nil_int_check(@marginLeft),GrabzIt::Utility.nil_int_check(@marginBottom),GrabzIt::Utility.nil_int_check(@marginRight),GrabzIt::Utility.nil_int_check(@delay),GrabzIt::Utility.nil_int_check(@requestAs),GrabzIt::Utility.nil_check(@country),GrabzIt::Utility.nil_int_check(@quality),GrabzIt::Utility.nil_check(@hideElement),GrabzIt::Utility.nil_check(@exportURL),GrabzIt::Utility.nil_check(@waitForElement),GrabzIt::Utility.nil_check(@encryptionKey),GrabzIt::Utility.b_to_str(@noAds),GrabzIt::Utility.nil_check(@post),GrabzIt::Utility.nil_check(@targetElement),GrabzIt::Utility.nil_check(@templateId),GrabzIt::Utility.nil_check(@templateVariables),GrabzIt::Utility.nil_int_check(@height),GrabzIt::Utility.nil_int_check(@width),GrabzIt::Utility.nil_int_check(@browserWidth),GrabzIt::Utility.nil_check(@proxy),GrabzIt::Utility.nil_check(@mergeId),GrabzIt::Utility.nil_check(@address),GrabzIt::Utility.b_to_str(@noCookieNotifications),GrabzIt::Utility.nil_check(@password))
|
|
404
|
+
items.push(GrabzIt::Utility.nil_check(callBackURL),GrabzIt::Utility.nil_check(@customId),GrabzIt::Utility.b_to_str(@includeBackground),@pagesize ,@orientation,GrabzIt::Utility.b_to_str(@includeImages),GrabzIt::Utility.b_to_str(@includeLinks),GrabzIt::Utility.nil_check(@title),GrabzIt::Utility.nil_int_check(@marginTop),GrabzIt::Utility.nil_int_check(@marginLeft),GrabzIt::Utility.nil_int_check(@marginBottom),GrabzIt::Utility.nil_int_check(@marginRight),GrabzIt::Utility.nil_int_check(@delay),GrabzIt::Utility.nil_int_check(@requestAs),GrabzIt::Utility.nil_check(@country),GrabzIt::Utility.nil_int_check(@quality),GrabzIt::Utility.nil_check(@hideElement),GrabzIt::Utility.nil_check(@exportURL),GrabzIt::Utility.nil_check(@waitForElement),GrabzIt::Utility.nil_check(@encryptionKey),GrabzIt::Utility.b_to_str(@noAds),GrabzIt::Utility.nil_check(@post),GrabzIt::Utility.nil_check(@targetElement),GrabzIt::Utility.nil_check(@templateId),GrabzIt::Utility.nil_check(@templateVariables),GrabzIt::Utility.nil_int_check(@height),GrabzIt::Utility.nil_int_check(@width),GrabzIt::Utility.nil_int_check(@browserWidth),GrabzIt::Utility.nil_check(@proxy),GrabzIt::Utility.nil_check(@mergeId),GrabzIt::Utility.nil_check(@address),GrabzIt::Utility.b_to_str(@noCookieNotifications),GrabzIt::Utility.nil_check(@password),GrabzIt::Utility.nil_check(@clickElement))
|
|
391
405
|
return items.join("|")
|
|
392
406
|
end
|
|
393
407
|
|
|
@@ -421,6 +435,7 @@ module GrabzIt
|
|
|
421
435
|
params['address'] = GrabzIt::Utility.nil_check(@address)
|
|
422
436
|
params['nonotify'] = GrabzIt::Utility.b_to_str(@noCookieNotifications)
|
|
423
437
|
params['password'] = GrabzIt::Utility.nil_check(@password)
|
|
438
|
+
params['click'] = GrabzIt::Utility.nil_check(@clickElement)
|
|
424
439
|
|
|
425
440
|
return params;
|
|
426
441
|
end
|
data/lib/grabzit/exception.rb
CHANGED
data/lib/grabzit/imageoptions.rb
CHANGED
|
@@ -23,6 +23,7 @@ module GrabzIt
|
|
|
23
23
|
@noCookieNotifications = false
|
|
24
24
|
@address = nil
|
|
25
25
|
@hd = false
|
|
26
|
+
@clickElement = nil
|
|
26
27
|
end
|
|
27
28
|
|
|
28
29
|
# @return [Integer] the width of the browser in pixels
|
|
@@ -140,6 +141,19 @@ module GrabzIt
|
|
|
140
141
|
# @return [void]
|
|
141
142
|
def waitForElement=(value)
|
|
142
143
|
@waitForElement = value
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# @return [String] get the CSS selector of the HTML element in the web page that must clicked before the capture is performed
|
|
147
|
+
def clickElement
|
|
148
|
+
@clickElement
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Set the CSS selector of the HTML element in the web page that must clicked before the capture is performed
|
|
152
|
+
#
|
|
153
|
+
# @param value [String] the element to click
|
|
154
|
+
# @return [void]
|
|
155
|
+
def clickElement=(value)
|
|
156
|
+
@clickElement = value
|
|
143
157
|
end
|
|
144
158
|
|
|
145
159
|
# @return [Integer] get which user agent type should be used
|
|
@@ -263,7 +277,7 @@ module GrabzIt
|
|
|
263
277
|
items.push(GrabzIt::Utility.nil_check(url))
|
|
264
278
|
end
|
|
265
279
|
|
|
266
|
-
items.push(GrabzIt::Utility.nil_check(callBackURL),GrabzIt::Utility.nil_check(@format),GrabzIt::Utility.nil_int_check(@height),GrabzIt::Utility.nil_int_check(@width),GrabzIt::Utility.nil_int_check(@browserHeight),GrabzIt::Utility.nil_int_check(@browserWidth),GrabzIt::Utility.nil_check(@customId),GrabzIt::Utility.nil_int_check(@delay),GrabzIt::Utility.nil_check(@targetElement),GrabzIt::Utility.nil_check(@customWaterMarkId),GrabzIt::Utility.nil_int_check(@requestAs),GrabzIt::Utility.nil_check(@country),GrabzIt::Utility.nil_int_check(@quality),GrabzIt::Utility.nil_check(@hideElement),GrabzIt::Utility.nil_check(@exportURL),GrabzIt::Utility.nil_check(@waitForElement),GrabzIt::Utility.b_to_str(@transparent),GrabzIt::Utility.nil_check(@encryptionKey),GrabzIt::Utility.b_to_str(@noAds),GrabzIt::Utility.nil_check(@post),GrabzIt::Utility.nil_check(@proxy),GrabzIt::Utility.nil_check(@address),GrabzIt::Utility.b_to_str(@noCookieNotifications),GrabzIt::Utility.b_to_str(@hd))
|
|
280
|
+
items.push(GrabzIt::Utility.nil_check(callBackURL),GrabzIt::Utility.nil_check(@format),GrabzIt::Utility.nil_int_check(@height),GrabzIt::Utility.nil_int_check(@width),GrabzIt::Utility.nil_int_check(@browserHeight),GrabzIt::Utility.nil_int_check(@browserWidth),GrabzIt::Utility.nil_check(@customId),GrabzIt::Utility.nil_int_check(@delay),GrabzIt::Utility.nil_check(@targetElement),GrabzIt::Utility.nil_check(@customWaterMarkId),GrabzIt::Utility.nil_int_check(@requestAs),GrabzIt::Utility.nil_check(@country),GrabzIt::Utility.nil_int_check(@quality),GrabzIt::Utility.nil_check(@hideElement),GrabzIt::Utility.nil_check(@exportURL),GrabzIt::Utility.nil_check(@waitForElement),GrabzIt::Utility.b_to_str(@transparent),GrabzIt::Utility.nil_check(@encryptionKey),GrabzIt::Utility.b_to_str(@noAds),GrabzIt::Utility.nil_check(@post),GrabzIt::Utility.nil_check(@proxy),GrabzIt::Utility.nil_check(@address),GrabzIt::Utility.b_to_str(@noCookieNotifications),GrabzIt::Utility.b_to_str(@hd),GrabzIt::Utility.nil_check(@clickElement))
|
|
267
281
|
|
|
268
282
|
return items.join("|")
|
|
269
283
|
end
|
|
@@ -289,6 +303,7 @@ module GrabzIt
|
|
|
289
303
|
params['address'] = GrabzIt::Utility.nil_check(@address)
|
|
290
304
|
params['nonotify'] = GrabzIt::Utility.b_to_str(@noCookieNotifications)
|
|
291
305
|
params['hd'] = GrabzIt::Utility.b_to_str(@hd)
|
|
306
|
+
params['click'] = GrabzIt::Utility.nil_check(@clickElement)
|
|
292
307
|
|
|
293
308
|
return params
|
|
294
309
|
end
|
data/lib/grabzit/pdfoptions.rb
CHANGED
|
@@ -35,6 +35,7 @@ module GrabzIt
|
|
|
35
35
|
@address = nil
|
|
36
36
|
@cssMediaType = nil
|
|
37
37
|
@password = nil
|
|
38
|
+
@clickElement = nil
|
|
38
39
|
end
|
|
39
40
|
|
|
40
41
|
# @return [Boolean] true if the background of the web page should be included in the PDF
|
|
@@ -338,6 +339,19 @@ module GrabzIt
|
|
|
338
339
|
def waitForElement=(value)
|
|
339
340
|
@waitForElement = value
|
|
340
341
|
end
|
|
342
|
+
|
|
343
|
+
# @return [String] get the CSS selector of the HTML element in the web page that must clicked before the capture is performed
|
|
344
|
+
def clickElement
|
|
345
|
+
@clickElement
|
|
346
|
+
end
|
|
347
|
+
|
|
348
|
+
# Set the CSS selector of the HTML element in the web page that must clicked before the capture is performed
|
|
349
|
+
#
|
|
350
|
+
# @param value [String] the element to click
|
|
351
|
+
# @return [void]
|
|
352
|
+
def clickElement=(value)
|
|
353
|
+
@clickElement = value
|
|
354
|
+
end
|
|
341
355
|
|
|
342
356
|
# @return [String] get the ID of a capture that should be merged at the beginning of the new PDF document
|
|
343
357
|
def mergeId
|
|
@@ -429,7 +443,7 @@ module GrabzIt
|
|
|
429
443
|
items.push(GrabzIt::Utility.nil_check(url))
|
|
430
444
|
end
|
|
431
445
|
|
|
432
|
-
items.push(GrabzIt::Utility.nil_check(callBackURL),GrabzIt::Utility.nil_check(@customId),GrabzIt::Utility.b_to_str(@includeBackground),@pagesize ,@orientation,GrabzIt::Utility.nil_check(@customWaterMarkId),GrabzIt::Utility.b_to_str(@includeLinks),GrabzIt::Utility.b_to_str(@includeOutline),GrabzIt::Utility.nil_check(@title),GrabzIt::Utility.nil_check(@coverURL),GrabzIt::Utility.nil_int_check(@marginTop),GrabzIt::Utility.nil_int_check(@marginLeft),GrabzIt::Utility.nil_int_check(@marginBottom),GrabzIt::Utility.nil_int_check(@marginRight),GrabzIt::Utility.nil_int_check(@delay),GrabzIt::Utility.nil_int_check(@requestAs),GrabzIt::Utility.nil_check(@country),GrabzIt::Utility.nil_int_check(@quality),GrabzIt::Utility.nil_check(@templateId),GrabzIt::Utility.nil_check(@hideElement),GrabzIt::Utility.nil_check(@targetElement),GrabzIt::Utility.nil_check(@exportURL),GrabzIt::Utility.nil_check(@waitForElement),GrabzIt::Utility.nil_check(@encryptionKey),GrabzIt::Utility.b_to_str(@noAds),GrabzIt::Utility.nil_check(@post),GrabzIt::Utility.nil_int_check(@browserWidth),GrabzIt::Utility.nil_int_check(@height),GrabzIt::Utility.nil_int_check(@width),GrabzIt::Utility.nil_check(@templateVariables),GrabzIt::Utility.nil_check(@proxy),GrabzIt::Utility.nil_check(@mergeId),GrabzIt::Utility.nil_check(@address),GrabzIt::Utility.b_to_str(@noCookieNotifications),GrabzIt::Utility.nil_check(@cssMediaType),GrabzIt::Utility.nil_check(@password))
|
|
446
|
+
items.push(GrabzIt::Utility.nil_check(callBackURL),GrabzIt::Utility.nil_check(@customId),GrabzIt::Utility.b_to_str(@includeBackground),@pagesize ,@orientation,GrabzIt::Utility.nil_check(@customWaterMarkId),GrabzIt::Utility.b_to_str(@includeLinks),GrabzIt::Utility.b_to_str(@includeOutline),GrabzIt::Utility.nil_check(@title),GrabzIt::Utility.nil_check(@coverURL),GrabzIt::Utility.nil_int_check(@marginTop),GrabzIt::Utility.nil_int_check(@marginLeft),GrabzIt::Utility.nil_int_check(@marginBottom),GrabzIt::Utility.nil_int_check(@marginRight),GrabzIt::Utility.nil_int_check(@delay),GrabzIt::Utility.nil_int_check(@requestAs),GrabzIt::Utility.nil_check(@country),GrabzIt::Utility.nil_int_check(@quality),GrabzIt::Utility.nil_check(@templateId),GrabzIt::Utility.nil_check(@hideElement),GrabzIt::Utility.nil_check(@targetElement),GrabzIt::Utility.nil_check(@exportURL),GrabzIt::Utility.nil_check(@waitForElement),GrabzIt::Utility.nil_check(@encryptionKey),GrabzIt::Utility.b_to_str(@noAds),GrabzIt::Utility.nil_check(@post),GrabzIt::Utility.nil_int_check(@browserWidth),GrabzIt::Utility.nil_int_check(@height),GrabzIt::Utility.nil_int_check(@width),GrabzIt::Utility.nil_check(@templateVariables),GrabzIt::Utility.nil_check(@proxy),GrabzIt::Utility.nil_check(@mergeId),GrabzIt::Utility.nil_check(@address),GrabzIt::Utility.b_to_str(@noCookieNotifications),GrabzIt::Utility.nil_check(@cssMediaType),GrabzIt::Utility.nil_check(@password),GrabzIt::Utility.nil_check(@clickElement))
|
|
433
447
|
|
|
434
448
|
return items.join("|")
|
|
435
449
|
end
|
|
@@ -467,7 +481,8 @@ module GrabzIt
|
|
|
467
481
|
params['nonotify'] = GrabzIt::Utility.b_to_str(@noCookieNotifications)
|
|
468
482
|
params['media'] = GrabzIt::Utility.nil_check(@cssMediaType)
|
|
469
483
|
params['password'] = GrabzIt::Utility.nil_check(@password)
|
|
470
|
-
|
|
484
|
+
params['click'] = GrabzIt::Utility.nil_check(@clickElement)
|
|
485
|
+
|
|
471
486
|
return params;
|
|
472
487
|
end
|
|
473
488
|
end
|
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.
|
|
4
|
+
version: 3.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- GrabzIt
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2021-07-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|
|
@@ -57,7 +57,7 @@ homepage: https://grabz.it/api/ruby
|
|
|
57
57
|
licenses:
|
|
58
58
|
- MIT
|
|
59
59
|
metadata: {}
|
|
60
|
-
post_install_message:
|
|
60
|
+
post_install_message:
|
|
61
61
|
rdoc_options: []
|
|
62
62
|
require_paths:
|
|
63
63
|
- lib
|
|
@@ -72,8 +72,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
72
72
|
- !ruby/object:Gem::Version
|
|
73
73
|
version: '0'
|
|
74
74
|
requirements: []
|
|
75
|
-
rubygems_version: 3.
|
|
76
|
-
signing_key:
|
|
75
|
+
rubygems_version: 3.1.6
|
|
76
|
+
signing_key:
|
|
77
77
|
specification_version: 4
|
|
78
78
|
summary: GrabzIt Ruby Client
|
|
79
79
|
test_files: []
|