website_information 0.5.7 → 0.5.8
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/README.md +4 -0
- data/lib/website_information/params/site.rb +8 -4
- data/lib/website_information/version.rb +1 -1
- 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: 212d7eb57089e42848e48939785ae1de86b95518
|
|
4
|
+
data.tar.gz: 720ec37fb8031380764b16de3bc2c41ea3c70631
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: defb7883d3252f56c95e62adf04f2c2a02e64a07c2f172d295cd16bd9d6ddc12dbfd48060630d378d58a57664b3260d0aa5cfc0cbb7bcffbe4c1960ec3bba9fe
|
|
7
|
+
data.tar.gz: 740655facd3ee1263c4a457332d4854fecde548838961b8f94f5d16ba137b459e176414354ddf0df52e6fc49af636d7e2439c25a4a49a55509699e2661779128
|
data/README.md
CHANGED
|
@@ -25,6 +25,10 @@ Please install [chromedriver](https://chromedriver.storage.googleapis.com/)(webd
|
|
|
25
25
|
|
|
26
26
|
Install chromedriver. https://chromedriver.storage.googleapis.com/ or ``` brew install chromedriver ```
|
|
27
27
|
|
|
28
|
+
#### Capture in heroku
|
|
29
|
+
|
|
30
|
+
If you use this gem in heroku, please install relational buildpacks (https://github.com/heroku/heroku-buildpack-chromedriver.git, https://github.com/heroku/heroku-buildpack-google-chrome.git) and your language's fontconfig to ``` ./fonts ```
|
|
31
|
+
|
|
28
32
|
## Usage
|
|
29
33
|
|
|
30
34
|
```
|
|
@@ -28,11 +28,15 @@ module WebsiteInformation
|
|
|
28
28
|
if @capture.nil?
|
|
29
29
|
binary = ENV.fetch('GOOGLE_CHROME_BIN', nil) # for heroku
|
|
30
30
|
options = Selenium::WebDriver::Chrome::Options.new(binary: binary, args: %w{headless no-sandbox disable-gpu})
|
|
31
|
-
# options.add_argument('--headless')
|
|
32
31
|
browser = Selenium::WebDriver.for :chrome, options: options
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
begin
|
|
33
|
+
browser.get @url
|
|
34
|
+
@capture = browser.screenshot_as(:png)
|
|
35
|
+
rescue
|
|
36
|
+
@capture = nil
|
|
37
|
+
ensure
|
|
38
|
+
browser.close
|
|
39
|
+
end
|
|
36
40
|
end
|
|
37
41
|
@capture
|
|
38
42
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: website_information
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
4
|
+
version: 0.5.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- miraoto
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-10-
|
|
11
|
+
date: 2017-10-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: nokogiri
|