website_information 0.3.1 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 80c9d99a92d374cac2729dfd7c587e385df688be
4
- data.tar.gz: c669d989f48bbf9e2dcf24340a48db5a90b49a10
3
+ metadata.gz: 32816eacdb673b1729514746e8accd51856937f5
4
+ data.tar.gz: e8a68e56fc58f3f422f1049145825cb73fc22a5c
5
5
  SHA512:
6
- metadata.gz: 3cd771ff27a918fd27aa29600613b476955eef96f1f6d1addda9113b38a79b182d7347c3c2dce45f2fa557b828938cd5420a66475c241bc7daa317766b2e6836
7
- data.tar.gz: 1a630b09740cdab3d2baa0b0195cc2767a9e6b71d0249d21d9f50ed726a34aa974e1fbb494dd0eb739d1562e88b4938af0147e7c8ef621ac3a63a3bb3aa00d95
6
+ metadata.gz: ddcc2a1cc82ec37312a90e3c97ba89a83273c2aedcf3f26601855d12342ccf9f2a6364aeb774be77762cbc7c700bf0e901cd8b209487326b3b6b6f905d07be38
7
+ data.tar.gz: f7cb3ec6ff61268a85ccc211dc921d9680b09fd118f2a6f050299e5d9a770bc32f9514b7c678d0b07555d60cc226952593f940c16e7fec646874e3d606151ca6
@@ -1,7 +1,7 @@
1
1
  module WebsiteInformation
2
2
  module Params
3
3
  class Site
4
- attr_accessor :url, :title, :capture
4
+ attr_accessor :url, :title, :capture, :feed
5
5
 
6
6
  def initialize(url)
7
7
  @url = url
@@ -1,3 +1,3 @@
1
1
  module WebsiteInformation
2
- VERSION = "0.3.1"
2
+ VERSION = "0.4.0"
3
3
  end
@@ -25,6 +25,12 @@ module WebsiteInformation
25
25
  @params.og.url = doc.css('//meta[property="og:url"]/@content').to_s
26
26
  @params.og.type = doc.css('//meta[property="og:type"]/@content').to_s
27
27
  @params.og.image = doc.css('//meta[property="og:image"]/@content').to_s
28
+ feed(doc)
29
+ end
30
+
31
+ def feed(doc)
32
+ @params.feed = doc.css('//link[@rel="alternate"][@type="application/atom+xml"]/@href').to_s
33
+ @params.feed ||= doc.css('//link[@rel="alternate"][@type="application/rss+xml"]/@href').to_s
28
34
  end
29
35
  end
30
36
  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.3.1
4
+ version: 0.4.0
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-17 00:00:00.000000000 Z
11
+ date: 2017-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri