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: 66b779546f8f2c837e044e40d161365baf2ca004
4
- data.tar.gz: 96689ad4ed3ac24d666b098c3ea2d4d9c057eb99
3
+ metadata.gz: bea117585bfa69485f75b5d59b4dad888798ac1d
4
+ data.tar.gz: e9154a2819b575e21dcf59a041939c77d7509f19
5
5
  SHA512:
6
- metadata.gz: 6649f8b62eba20a02792fea7ac4b7b9018fe73c5a2fb3f8dee7587664cf561b4f7e8b5a54e4fbfa02202e019f7e30a8e414c7d708a7bed751a4cd5a26b3b787c
7
- data.tar.gz: f22445e5ea8b082f61ee9c15995d4da57fd05e722f16dfe673e0f114c8f1da6bd9f95412b90025e8154b5c4f8947b9290265842edee4bd0564712ec84e2b60d2
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
@@ -1,3 +1,3 @@
1
1
  class LinkOracle
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
@@ -1,8 +1,13 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe LinkOracle::Extractor::Meta do
4
- let(:parsed_body) { ::Nokogiri::HTML.parse(body) }
5
- let(:link_data) { LinkOracle::Extractor::Meta.new(parsed_body).perform }
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(:parsed_body) { ::Nokogiri::HTML.parse(body) }
5
- let(:link_data) { LinkOracle::Extractor::OG.new(parsed_body).perform }
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>
@@ -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.3
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-07-10 00:00:00.000000000 Z
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.2.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