curation 1.0 → 1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/curation.rb +3 -3
- data/lib/curation/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14637da5bf7b047f9c34b40ff4bf108110dce7408d3c12af9e76222141bdcf65
|
4
|
+
data.tar.gz: 144487e448354476958895db783fdc681d0116ec3eca5e7ede1cd3cf1bd1d13a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 303babe96daee5e792672e1ece05b49d77c115e393af00ded6902b10b9d4adb51210923c7d6c0e68a359246078618a8d09606ab57dd57fa0882db7e3a474e3e4
|
7
|
+
data.tar.gz: 451a1ad8866adc91850ff9b150847564bb9de43b15432de2dbf06fb2936a3788ed2c0bf4d9e3c9c462e13bdb5c6236bf5dc0c97a6697a8c3ea9c307bf2f35410
|
data/lib/curation.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
require "curation/version"
|
2
|
+
require "metainspector"
|
3
|
+
require "open-uri"
|
2
4
|
|
3
5
|
module Curation
|
4
6
|
class Error < StandardError; end
|
@@ -32,7 +34,7 @@ module Curation
|
|
32
34
|
|
33
35
|
def image
|
34
36
|
@image = find_image
|
35
|
-
@image = @image.gsub('http://', 'https://')
|
37
|
+
@image = @image.to_s.gsub('http://', 'https://')
|
36
38
|
@image
|
37
39
|
end
|
38
40
|
|
@@ -44,7 +46,6 @@ module Curation
|
|
44
46
|
return ld['articleBody'] if ld.has_key? 'articleBody'
|
45
47
|
end
|
46
48
|
end
|
47
|
-
text = ''
|
48
49
|
h = html.dup
|
49
50
|
BLACKLIST.each do |tag|
|
50
51
|
h.css(tag).remove
|
@@ -96,7 +97,6 @@ module Curation
|
|
96
97
|
end
|
97
98
|
|
98
99
|
def data
|
99
|
-
require 'open-uri'
|
100
100
|
URI.open url
|
101
101
|
rescue
|
102
102
|
puts "Impossible to open #{url}"
|
data/lib/curation/version.rb
CHANGED