link_oracle 0.1.3 → 0.1.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bea117585bfa69485f75b5d59b4dad888798ac1d
|
4
|
+
data.tar.gz: e9154a2819b575e21dcf59a041939c77d7509f19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d59d5961e6eafedd3ee53c48dca84d7e247f7ac48b94f0336bf3dd2eaf00a4fe2fc18e90b9d2e506aad75a6d6363756c3b21d67ed432ce4b743e5f2737d958f7
|
7
|
+
data.tar.gz: 65b6316b6fad3166f3d22bfc416e2e4219062c941dc114d2cc0717793d190218ef1c58991912299ac8d50ff814b3ec3ed882f0d87851bc3df581bf5ade557833
|
@@ -8,11 +8,11 @@ class LinkOracle
|
|
8
8
|
|
9
9
|
#TODO: Need to write tests for these
|
10
10
|
def title
|
11
|
-
og.title || meta.title || body.title
|
11
|
+
(og.title || meta.title || body.title).strip
|
12
12
|
end
|
13
13
|
|
14
14
|
def description
|
15
|
-
og.description || meta.description|| body.description
|
15
|
+
(og.description || meta.description || body.description).strip
|
16
16
|
end
|
17
17
|
|
18
18
|
def image_url
|
data/lib/link_oracle/version.rb
CHANGED
@@ -1,8 +1,13 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe LinkOracle::Extractor::Meta do
|
4
|
-
let(:
|
5
|
-
|
4
|
+
let(:parsed_url) {
|
5
|
+
{
|
6
|
+
parsed_data: ::Nokogiri::HTML.parse(body),
|
7
|
+
url: 'www.some-url.com'
|
8
|
+
}
|
9
|
+
}
|
10
|
+
let(:link_data) { LinkOracle::Extractor::Meta.new(parsed_url).perform }
|
6
11
|
|
7
12
|
let(:body) {
|
8
13
|
"<html>
|
@@ -1,8 +1,13 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe LinkOracle::Extractor::OG do
|
4
|
-
let(:
|
5
|
-
|
4
|
+
let(:parsed_url) {
|
5
|
+
{
|
6
|
+
parsed_data: ::Nokogiri::HTML.parse(body),
|
7
|
+
url: 'www.some-url.com'
|
8
|
+
}
|
9
|
+
}
|
10
|
+
let(:link_data) { LinkOracle::Extractor::OG.new(parsed_url).perform }
|
6
11
|
|
7
12
|
let(:body) {
|
8
13
|
"<html>
|
data/spec/link_preview_spec.rb
CHANGED
@@ -16,7 +16,7 @@ describe LinkOracle do
|
|
16
16
|
<html>
|
17
17
|
<head>
|
18
18
|
<meta property="og:title" content="This is a title">
|
19
|
-
<meta property="og:description" content="A description for your face">
|
19
|
+
<meta property="og:description" content=" A description for your face\n">
|
20
20
|
<meta property="og:image" content="http://imageurl.com">
|
21
21
|
<meta name="Description" content="Here is a description not for facebook">
|
22
22
|
<meta name="KEYWORDS" content="Keywords, Keywords everywhere">
|
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.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ian Cooper
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2014-
|
16
|
+
date: 2014-09-24 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: nokogiri
|
@@ -163,7 +163,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
163
163
|
version: '0'
|
164
164
|
requirements: []
|
165
165
|
rubyforge_project:
|
166
|
-
rubygems_version: 2.
|
166
|
+
rubygems_version: 2.0.14
|
167
167
|
signing_key:
|
168
168
|
specification_version: 4
|
169
169
|
summary: Scrapes pages for open graph, meta, and lastly, body preview data
|