website_information 0.2.0 → 0.2.1
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1857778face4ceaa95bd982193b2f05626e1912a
|
4
|
+
data.tar.gz: e5a685bc8203446bca1ad53a5dc6d1885e56f3e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 550814769893856816c40df06fdbb9285162e8ab58f4cbc6205e67b2e8679388df5b1447c25cd28d81a3f20e89088304744b11467b33a279b61bec0c0512b154
|
7
|
+
data.tar.gz: cfe38164fa75e2310d62ac661629ac447de25d16fb5bc21a9db95940361b5de65a01d7d81f0364c1f823a86e53ee9ae875ed703af604a40c1ed5c6f64696d2ea
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module WebsiteInformation
|
2
2
|
module Params
|
3
3
|
class Site
|
4
|
-
attr_accessor :url, :title
|
4
|
+
attr_accessor :url, :title, :capture
|
5
5
|
|
6
6
|
def initialize(url)
|
7
7
|
@url = url
|
@@ -16,11 +16,6 @@ module WebsiteInformation
|
|
16
16
|
def og
|
17
17
|
@og
|
18
18
|
end
|
19
|
-
|
20
|
-
def capture
|
21
|
-
return if ENV['CAPTURE_URL'].nil?
|
22
|
-
"#{ENV['CAPTURE_URL']}#{@url}"
|
23
|
-
end
|
24
19
|
end
|
25
20
|
end
|
26
21
|
end
|
@@ -5,6 +5,7 @@ module WebsiteInformation
|
|
5
5
|
def initialize(url)
|
6
6
|
@params = WebsiteInformation::Params::Site.new(url)
|
7
7
|
scrape(url)
|
8
|
+
capture(url)
|
8
9
|
end
|
9
10
|
|
10
11
|
def scraped_params
|
@@ -25,5 +26,9 @@ module WebsiteInformation
|
|
25
26
|
@params.og.type = doc.css('//meta[property="og:type"]/@content').to_s
|
26
27
|
@params.og.image = doc.css('//meta[property="og:image"]/@content').to_s
|
27
28
|
end
|
29
|
+
|
30
|
+
def capture(url)
|
31
|
+
@params.capture = ENV['CAPTURE_URL'].nil? ? nil : "#{ENV['CAPTURE_URL']}#{url}"
|
32
|
+
end
|
28
33
|
end
|
29
34
|
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.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- miraoto
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-09-
|
11
|
+
date: 2017-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -127,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
127
127
|
version: '0'
|
128
128
|
requirements: []
|
129
129
|
rubyforge_project:
|
130
|
-
rubygems_version: 2.6.
|
130
|
+
rubygems_version: 2.6.13
|
131
131
|
signing_key:
|
132
132
|
specification_version: 4
|
133
133
|
summary: scrape website information that title, meta, page capture, description, ogp
|