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: c1f618f87459edd9a2fb37519d16c064015c7576
4
- data.tar.gz: ff4cad05a64d9758d26b03a3fb93551b13bf1180
3
+ metadata.gz: 1857778face4ceaa95bd982193b2f05626e1912a
4
+ data.tar.gz: e5a685bc8203446bca1ad53a5dc6d1885e56f3e3
5
5
  SHA512:
6
- metadata.gz: d52522bae8b866c2e4798c39d9a78019580e0f26eea8e13b6e30e860488240ca2ddb35097409f8d44f8bd1274a84245aa0d9d4291a9ebbfee43fa04f537a1d2f
7
- data.tar.gz: adb81f57b949f6d7141ab9e1e05a6822af3989c2356268d31d9d4cfb1caf50b4c193b58acc607cf8f06eb64d3661ae754232a019d15b682c362a45f4b86effe0
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
@@ -1,3 +1,3 @@
1
1
  module WebsiteInformation
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  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.0
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-10 00:00:00.000000000 Z
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.8
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