link_oracle 0.0.8 → 0.1.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d04bcd248e73e3676f3336a6f449e08befb632aa
|
4
|
+
data.tar.gz: f94766cf28495826f93005976edd5c6f27b4b113
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0bcfabb56e346fd6f2295492e4e6544f9a481318c589ef602f7ca36edb8f752ad3786b44f8a5dea3285cd7988a7e87eb2a3310992e160c492f6f8cdc6911fee0
|
7
|
+
data.tar.gz: e064cfd38d170b0a5bc2f156e07db5f08bb4d8495670b892d81bf2670cf296c703105330faa4ee2aa8cecc1a31d2c4d5ded3e421f70ffafff2c9f1521be19c0c
|
data/lib/link_oracle/version.rb
CHANGED
@@ -32,6 +32,30 @@ describe LinkOracle::Extractor::Meta do
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
+
context "the meta data is there but blank" do
|
36
|
+
let(:body) {
|
37
|
+
"<html>
|
38
|
+
<head>
|
39
|
+
<meta name=\"Description\" content=\"\">
|
40
|
+
<title></title>
|
41
|
+
<meta itemprop='thumbnailUrl' name='thumbnail' content=''>
|
42
|
+
</head>
|
43
|
+
</html>"
|
44
|
+
}
|
45
|
+
|
46
|
+
it 'should set link_data title to nil' do
|
47
|
+
link_data.title.should == nil
|
48
|
+
end
|
49
|
+
|
50
|
+
it 'should set link_data image_url to nil' do
|
51
|
+
link_data.image_url.should == nil
|
52
|
+
end
|
53
|
+
|
54
|
+
it 'should set link_data description to nil' do
|
55
|
+
link_data.description.should == nil
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
35
59
|
context 'there is meta data' do
|
36
60
|
it 'should populate link_data title' do
|
37
61
|
link_data.title.should == 'TITLE!'
|
@@ -46,4 +70,4 @@ describe LinkOracle::Extractor::Meta do
|
|
46
70
|
end
|
47
71
|
end
|
48
72
|
end
|
49
|
-
end
|
73
|
+
end
|
@@ -34,6 +34,33 @@ describe LinkOracle::Extractor::OG do
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
+
context "the og data is blank" do
|
38
|
+
let(:body) {
|
39
|
+
"<html>
|
40
|
+
<head>
|
41
|
+
<meta property=\"og:title\" content=\"\">
|
42
|
+
<meta property=\"og:description\" content=\"\">
|
43
|
+
<meta property=\"og:image\" content=\"\">
|
44
|
+
<meta name=\"Description\" content=\" \tHere is a description not for facebook\t\">
|
45
|
+
<meta name=\"KEYWORDS\" content=\" \tKeywords, Keywords everywhere \t\">
|
46
|
+
<title>TITLE!</title>
|
47
|
+
</head>
|
48
|
+
</html>"
|
49
|
+
}
|
50
|
+
|
51
|
+
it 'should set title to nil' do
|
52
|
+
link_data.title.should == nil
|
53
|
+
end
|
54
|
+
|
55
|
+
it 'should set description to nil' do
|
56
|
+
link_data.description.should == nil
|
57
|
+
end
|
58
|
+
|
59
|
+
it 'should set image to nil' do
|
60
|
+
link_data.image_url.should == nil
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
37
64
|
context 'there is og_data' do
|
38
65
|
|
39
66
|
it 'should populate link_data title' do
|
@@ -49,4 +76,4 @@ describe LinkOracle::Extractor::OG do
|
|
49
76
|
end
|
50
77
|
end
|
51
78
|
end
|
52
|
-
end
|
79
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: link_oracle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ian Cooper
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2014-05-
|
14
|
+
date: 2014-05-23 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: nokogiri
|