curation 1.4 → 1.5

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: 71f7502a62d7bbb12799e869c1e5c64bd3e514c7ed97190790d42675451d48d1
4
- data.tar.gz: 5cec6d6556dce75884b2e1a5e92e0d34744b623fcfb81b8b52684974a980f8b8
3
+ metadata.gz: 15ed9203a4164d0cfdfb7e973523008ddfe518ce21016731ae8a1dcddc74b0ab
4
+ data.tar.gz: e2269fbae2d6a6355f90709409de0fa1dd3e555dfd533b10d00d1073af0ac9ec
5
5
  SHA512:
6
- metadata.gz: 39dabe191b310e192e663836e00b8e4c28c716685cf05e0d86c807cc968b43d525480c8488b1d93e68c30b931d2d30560e445d3693458f78f937c76e38d788eb
7
- data.tar.gz: ac5786df34fca74a9b7e6f336b630ce89baebf1720c01e48ac87c3f933457259276035587dbe0d922fa3096acb55cdfb392a1869b8c412eebaba214f66cd4f63
6
+ metadata.gz: 72df82702be64fcee4e1e7725ecb3c1f831c036040c2ef445388feb493a43cd78b979ed63e99dd0168399c2bd014a0a00e2f7211f561b0ba88f13d0098daaa68
7
+ data.tar.gz: dd439269683719541f49204484e7d7fd42cbc0f0320e488d2f12a5a36bc472cd343343c4697d0a84a3f8746a308dad03b5e84e33b03adedd3984de73082e5bbb
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- curation (1.4)
4
+ curation (1.5)
5
5
  metainspector
6
6
  nokogiri
7
7
 
@@ -61,13 +61,17 @@ module Curation
61
61
  return ld['headline'] if ld.has_key? 'headline'
62
62
  end
63
63
  end
64
- [
65
- metainspector.best_title,
66
- metainspector.title,
67
- nokogiri.css('[itemprop="headline"]')&.first&.inner_text,
68
- nokogiri.css('title')&.first&.inner_text
69
- ].each do |possibility|
70
- return possibility unless possibility.blank?
64
+ begin
65
+ [
66
+ metainspector.best_title,
67
+ metainspector.title,
68
+ nokogiri.css('[itemprop="headline"]')&.first&.inner_text,
69
+ nokogiri.css('title')&.first&.inner_text
70
+ ].each do |possibility|
71
+ return possibility unless possibility.blank?
72
+ end
73
+ rescue
74
+ puts 'Curation::Page find_title error'
71
75
  end
72
76
  return ''
73
77
  end
@@ -87,11 +91,15 @@ module Curation
87
91
  end
88
92
  end
89
93
  end
90
- [
91
- metainspector.images.best,
92
- nokogiri.css('[property="og:image"]').first&.attributes["content"].value
93
- ].each do |possibility|
94
- return possibility unless possibility.blank?
94
+ begin
95
+ [
96
+ metainspector.images.best,
97
+ nokogiri.css('[property="og:image"]').first&.attributes['content'].value
98
+ ].each do |possibility|
99
+ return possibility unless possibility.blank?
100
+ end
101
+ rescue
102
+ puts 'Curation::Page find_image error'
95
103
  end
96
104
  return ''
97
105
  end
@@ -107,7 +115,7 @@ module Curation
107
115
  @json_ld << hash
108
116
  end
109
117
  rescue
110
- puts "JSON LD error"
118
+ puts 'Curation::Page json_ld error'
111
119
  end
112
120
  end
113
121
  @json_ld
@@ -122,13 +130,13 @@ module Curation
122
130
  def nokogiri
123
131
  @nokogiri ||= Nokogiri::HTML html
124
132
  rescue
125
- puts "Nokogiri error"
133
+ puts 'Curation::Page nokogiri error'
126
134
  end
127
135
 
128
136
  def metainspector
129
137
  @metainspector ||= MetaInspector.new url, document: html
130
138
  rescue
131
- puts "MetaInspector error"
139
+ puts 'Curation::Page metainspector error'
132
140
  end
133
141
  end
134
142
  end
@@ -1,3 +1,3 @@
1
1
  module Curation
2
- VERSION = "1.4"
2
+ VERSION = "1.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: curation
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.4'
4
+ version: '1.5'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arnaud Levy