trawler 0.0.3 → 0.0.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: d4dae42eded6ebcc957c1698005a183dba23bf22
4
- data.tar.gz: e813de043eb6984f7027624a0f6820bb06baff69
3
+ metadata.gz: 5f92ac5258476cb629c3ee84fc07659779e482c3
4
+ data.tar.gz: d87eaf3f6018633a3c35c532e6e72a8dc8af2d38
5
5
  SHA512:
6
- metadata.gz: 9f89defee433fa347c8eb2f1ea2ae16ffedd0bc032adfea622fa847a6b4e553440ae5ecbf75304e6435cdbcef3138c492700cd90536566238e9bcb6cf5e27960
7
- data.tar.gz: a66e38a3293a817f2d0d67594e09e53dd5b5ce6e22f6d0c66398a1fb7dfa651055d167c189f2ec51feefc42fef80a7eb078dfd1f925b0cfacd6ada46c1faf153
6
+ metadata.gz: 25564d07389a40842aeb069f799b6cbfed26e8b5a196eda9c5b4f6fcca11314e319b5a694327b27da6a7af6454437c8344f5bde66138ed705ef2c1c577109869
7
+ data.tar.gz: 1f5897559c9bb75555bcfccb812bdbb5889c34a32a03f4c394e3a7fd5d46c7b200d07a063f9ed305dba183361c63530d6b5d7cbaea1d7577cb35702870aa0598
@@ -23,6 +23,10 @@ module Trawler
23
23
  data.description
24
24
  end
25
25
 
26
+ def video_still
27
+ data.video_still
28
+ end
29
+
26
30
  def raw_data
27
31
  @raw_data ||= data.document
28
32
  end
@@ -49,6 +49,10 @@ module Trawler
49
49
  @document ||= Nokogiri::HTML(@page)
50
50
  end
51
51
 
52
+ def video_still
53
+ meta_image
54
+ end
55
+
52
56
  private
53
57
 
54
58
  def html_title
@@ -1,3 +1,3 @@
1
1
  module Trawler
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -2,7 +2,7 @@ require "spec_helper"
2
2
 
3
3
  describe Trawler::ParsedDocument do
4
4
 
5
- let(:data) { double("PARSER", images: ["foo"], title: "foobar", video: "bar", description: "foobarbaz", document: "") }
5
+ let(:data) { double("PARSER", images: ["foo"], title: "foobar", video: "bar", video_still: "barfoo", description: "foobarbaz", document: "") }
6
6
  let(:doc) { Trawler::ParsedDocument.new("www.cats.com", data) }
7
7
 
8
8
  it "sets the url" do
@@ -29,4 +29,8 @@ describe Trawler::ParsedDocument do
29
29
  it "has the raw data" do
30
30
  expect(doc.raw_data).to eq ""
31
31
  end
32
+
33
+ it "has the video still" do
34
+ expect(doc.video_still).to eq "barfoo"
35
+ end
32
36
  end
data/spec/parser_spec.rb CHANGED
@@ -65,6 +65,10 @@ describe Trawler::Parser do
65
65
  it "gets the images" do
66
66
  expect(parser.images).to include "http://i1.ytimg.com/vi/OrIFaWJ9Glo/maxresdefault.jpg"
67
67
  end
68
+
69
+ it "gets an image as the placeholder for the video" do
70
+ expect(parser.video_still).to eq "http://i1.ytimg.com/vi/OrIFaWJ9Glo/maxresdefault.jpg"
71
+ end
68
72
  end
69
73
 
70
74
  context "document style page" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trawler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Wheeler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-18 00:00:00.000000000 Z
11
+ date: 2013-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri