web_stat 0.3.12 → 0.3.13

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
  SHA256:
3
- metadata.gz: 2af80415014e94830b1e323f44e2e71732196bdfc535627295f1f6b7b2f44285
4
- data.tar.gz: 85fc9facafff40063c434824ebc64fcd847f347bdfa0c928ee8c35b2b3e0c8b5
3
+ metadata.gz: 6021c6bacb394385b1e5634449f4a3adfb27a5c2d799f9d0874084889a3ac66c
4
+ data.tar.gz: d35180f95d0937b69df93dc5ba051edb8eeb79b52bd6df0e8770c849bc33c511
5
5
  SHA512:
6
- metadata.gz: 30870501431d61d5d90bdcfcf4f6ba339918b810fda48bd9a77abe183e341575bc9c7397aadb7494da1591d5d647fea7b17512ed24cea61471d4e112a0c17bd8
7
- data.tar.gz: 8340739ddae12fd6a670d51e7fcd7e3987294bcb32219cde6e8dbcee2a067f064b2b632d102636471d0b7fd0ff27ca4f55c477eca94d88b7194a3cf17b1869c7
6
+ metadata.gz: 812aa33c7a4d8642b1239d05b8a0f2fa6bc938379f48e998732d71dcdd40c5c15d04b2795dde6b7e9cee0f439a12ad5b7259bc58fe741076106108bbc6c16d90
7
+ data.tar.gz: 3bf21e030a43868ccee4c45fe1e8993c6375b85f05d74ec3b11d68b97fe10a09194e186cfd942c3fe03f9ad2ce009e5ed15edefb06d21830180f9b04bd2fd8ea
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- web_stat (0.3.11)
4
+ web_stat (0.3.12)
5
5
  bundler (>= 2.0.2)
6
6
  cld (>= 0.8.0)
7
7
  mechanize (>= 2.7)
@@ -47,8 +47,12 @@ module WebStat
47
47
  break
48
48
  end
49
49
  end
50
- if (path.nil? || path.empty?) && @nokogiri.xpath('//img')
51
- path = @nokogiri.xpath('//img').attr('src')
50
+ readability_content = Readability::Document.new(@nokogiri.at('body')).content
51
+ if (path.nil? || path.empty?) && readability_content.xpath('//img').first
52
+ path = ::Nokogiri::HTML(readability_content).xpath('//img').first.attr('src')
53
+ end
54
+ if (path.nil? || path.empty?) && @nokogiri.xpath('//img').first
55
+ path = @nokogiri.xpath('//img').first.attr('src')
52
56
  end
53
57
  if ! path.nil? && path.match(/^\//)
54
58
  "#{URI.parse(@url).scheme}://#{URI.parse(@url).host}#{path}"
@@ -1,3 +1,3 @@
1
1
  module WebStat
2
- VERSION = "0.3.12"
2
+ VERSION = "0.3.13"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: web_stat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.12
4
+ version: 0.3.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - yusuke abe