link_previewer 0.0.1.alpha
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +17 -0
- data/.travis.yml +14 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +33 -0
- data/Rakefile +11 -0
- data/lib/link_previewer.rb +6 -0
- data/lib/link_previewer/parser.rb +34 -0
- data/lib/link_previewer/previewer.rb +38 -0
- data/lib/link_previewer/version.rb +3 -0
- data/link_previewer.gemspec +33 -0
- data/spec/fixtures/normal.html +23 -0
- data/spec/fixtures/opengraph.html +29 -0
- data/spec/fixtures/twitter.html +26 -0
- data/spec/parser_spec.rb +33 -0
- data/spec/previewer_spec.rb +54 -0
- data/spec/spec_helper.rb +12 -0
- metadata +221 -0
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NGQ3NjlkMWQ0MDY5ZDU5ZTc5ZDg0MTA5NTg1MjY5NTljZmNjNzg3NA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
MDQ4YWM0NmYzM2YyMmNkN2UwMWNkMzJhNWZkMjlhNmRlOWNlNzI1YQ==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
MGVjMjI0YWY3ZjljZTZhMGUyNDcyZDRjZjljM2NmNzM2NDc2YTFhNmM1ODkw
|
10
|
+
YTI0NGY2MTQ0OTY2NjllMjZjY2EyNzgwNGYyNDVkMzdkMDc2NzcxZDA4ZTRk
|
11
|
+
MDhhNDJkYjgxZjIxM2FkNjk1NjA4MmM1ZmNmYTY0ZThjNWQ1YjI=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
YzNjNDMwYjQ2MzM5ZmZjMjUzY2M5NTVkNWMwNGJkM2JiMDg4ODI2OTRjNDk4
|
14
|
+
Nzg4ZDk3ZDNlMDdlMmUxOWUwNzRhMGU1ZDU0NjUwYTI4ZGVlYmUxYmVlMWU5
|
15
|
+
ZmYyMjE0YjQzNDk1ODI5MzY5NjVhNmRjYjQ4NDFjN2JkNzU0OWU=
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Lucas Polonio
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
[![Build Status](https://travis-ci.org/lucaspolonio/link_previewer.svg?branch=master)](https://travis-ci.org/lucaspolonio/link_previewer)
|
2
|
+
[![Code Climate](https://codeclimate.com/github/lucaspolonio/link_previewer.png)](https://codeclimate.com/github/lucaspolonio/link_previewer)
|
3
|
+
|
4
|
+
# LinkPreviewer - alpha
|
5
|
+
|
6
|
+
Ruby gem that generates URL previews similarly to what happens when you paste a link on facebook chat.
|
7
|
+
Tries to detect the best title, description and images to preview a link.
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
Add this line to your application's Gemfile:
|
12
|
+
|
13
|
+
gem 'link_previewer'
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install link_previewer
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO
|
26
|
+
|
27
|
+
## Contributing
|
28
|
+
|
29
|
+
1. Fork it ( http://github.com/lucaspolonio/link_previewer/fork )
|
30
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
31
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
32
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
33
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'rspec/core/rake_task'
|
2
|
+
require 'bundler/gem_tasks'
|
3
|
+
|
4
|
+
# Default directory to look in is `/specs`
|
5
|
+
# Run with `rake spec`
|
6
|
+
RSpec::Core::RakeTask.new(:spec) do |task|
|
7
|
+
task.pattern = "spec/**/*_spec.rb"
|
8
|
+
task.rspec_opts = ['--color']
|
9
|
+
end
|
10
|
+
|
11
|
+
task :default => :spec
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'nokogiri'
|
2
|
+
require 'open-uri'
|
3
|
+
|
4
|
+
module LinkPreviewer
|
5
|
+
class Parser
|
6
|
+
|
7
|
+
def initialize(url)
|
8
|
+
@nokogiri_html = Nokogiri::HTML(open(url))
|
9
|
+
end
|
10
|
+
|
11
|
+
def tag_contents(tag)
|
12
|
+
el = @nokogiri_html.css(tag).first
|
13
|
+
el.content if el
|
14
|
+
end
|
15
|
+
|
16
|
+
def meta_tag_contents(meta_tag_selector)
|
17
|
+
el = @nokogiri_html.css(meta_tag_selector).first
|
18
|
+
el.attr('content') if el
|
19
|
+
end
|
20
|
+
|
21
|
+
def meta_tag_contents_by_property(property)
|
22
|
+
meta_tag_contents "meta[@property='#{property}']"
|
23
|
+
end
|
24
|
+
|
25
|
+
def meta_tag_contents_by_name(name)
|
26
|
+
meta_tag_contents "meta[name='#{name}']"
|
27
|
+
end
|
28
|
+
|
29
|
+
def image_src(css_selector)
|
30
|
+
@nokogiri_html.css(css_selector).map{|el| el['src']}
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module LinkPreviewer
|
2
|
+
class Previewer
|
3
|
+
|
4
|
+
def initialize(url)
|
5
|
+
@parser = Parser.new(url)
|
6
|
+
end
|
7
|
+
|
8
|
+
def title
|
9
|
+
if (og_title = @parser.meta_tag_contents_by_property 'og:title')
|
10
|
+
return og_title
|
11
|
+
elsif (twitter_title = @parser.meta_tag_contents_by_property 'twitter:title')
|
12
|
+
return twitter_title
|
13
|
+
elsif (meta_title = @parser.tag_contents 'title')
|
14
|
+
return meta_title
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def description
|
19
|
+
if (og_description = @parser.meta_tag_contents_by_property 'og:description')
|
20
|
+
return og_description
|
21
|
+
elsif (twitter_description = @parser.meta_tag_contents_by_property 'twitter:description')
|
22
|
+
return twitter_description
|
23
|
+
elsif (meta_description = @parser.meta_tag_contents_by_name 'description')
|
24
|
+
return meta_description
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def images
|
29
|
+
images = []
|
30
|
+
if (og_image = @parser.meta_tag_contents_by_property 'og:image')
|
31
|
+
return images << og_image
|
32
|
+
elsif (twitter_image = @parser.meta_tag_contents_by_property 'twitter:image')
|
33
|
+
return images << twitter_image
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'link_previewer/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "link_previewer"
|
8
|
+
spec.version = LinkPreviewer::VERSION
|
9
|
+
spec.authors = ["Lucas Polonio"]
|
10
|
+
spec.email = ["polonio.lucas@gmail.com"]
|
11
|
+
spec.summary = "A facebook-style link previewer."
|
12
|
+
spec.description = "A facebook-style link previewer (title, description and images)."
|
13
|
+
spec.homepage = ""
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.5"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
spec.add_development_dependency "rspec"
|
24
|
+
spec.add_development_dependency "rspec-nc"
|
25
|
+
spec.add_development_dependency "guard"
|
26
|
+
spec.add_development_dependency "guard-rspec"
|
27
|
+
spec.add_development_dependency "pry"
|
28
|
+
spec.add_development_dependency "pry-remote"
|
29
|
+
spec.add_development_dependency "pry-nav"
|
30
|
+
spec.add_development_dependency "nokogiri"
|
31
|
+
spec.add_development_dependency "webmock"
|
32
|
+
|
33
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
6
|
+
|
7
|
+
<title>Page title</title>
|
8
|
+
<meta name="description" content="Page description">
|
9
|
+
|
10
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
11
|
+
<link href='http://fonts.googleapis.com/css?family=Roboto:300' rel='stylesheet' type='text/css'>
|
12
|
+
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
|
13
|
+
<link rel="stylesheet" href="main.css">
|
14
|
+
</head>
|
15
|
+
<body>
|
16
|
+
<div class="container">
|
17
|
+
<div class="row">
|
18
|
+
example
|
19
|
+
<img id="first_image" src="image.jpg">
|
20
|
+
</div>
|
21
|
+
</div>
|
22
|
+
</body>
|
23
|
+
</html>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
6
|
+
|
7
|
+
<title>Page title</title>
|
8
|
+
<meta name="description" content="Page description">
|
9
|
+
<meta property="twitter:title" content="Page Twitter Tag title" />
|
10
|
+
<meta property="twitter:description" content="Page Twitter Tag description" />
|
11
|
+
<meta property="twitter:image" content="twitter-image.jpg" />
|
12
|
+
<meta property="og:title" content="Page Open Graph title" />
|
13
|
+
<meta property="og:description" content="Page Open Graph description" />
|
14
|
+
<meta property="og:image" content="opengraph-image.jpg" />
|
15
|
+
|
16
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
17
|
+
<link href='http://fonts.googleapis.com/css?family=Roboto:300' rel='stylesheet' type='text/css'>
|
18
|
+
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
|
19
|
+
<link rel="stylesheet" href="main.css">
|
20
|
+
</head>
|
21
|
+
<body>
|
22
|
+
<div class="container">
|
23
|
+
<div class="row">
|
24
|
+
example
|
25
|
+
<img id="first_image" src="image.jpg">
|
26
|
+
</div>
|
27
|
+
</div>
|
28
|
+
</body>
|
29
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
6
|
+
|
7
|
+
<title>Page title</title>
|
8
|
+
<meta name="description" content="Page description">
|
9
|
+
<meta property="twitter:title" content="Page Twitter Tag title" />
|
10
|
+
<meta property="twitter:description" content="Page Twitter Tag description" />
|
11
|
+
<meta property="twitter:image" content="twitter-image.jpg" />
|
12
|
+
|
13
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
14
|
+
<link href='http://fonts.googleapis.com/css?family=Roboto:300' rel='stylesheet' type='text/css'>
|
15
|
+
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
|
16
|
+
<link rel="stylesheet" href="main.css">
|
17
|
+
</head>
|
18
|
+
<body>
|
19
|
+
<div class="container">
|
20
|
+
<div class="row">
|
21
|
+
example
|
22
|
+
<img id="first_image" src="image.jpg">
|
23
|
+
</div>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
data/spec/parser_spec.rb
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module LinkPreviewer
|
4
|
+
class Parser
|
5
|
+
|
6
|
+
describe Parser do
|
7
|
+
|
8
|
+
let(:og_parser) { Parser.new('http://www.opengraph-example.com') }
|
9
|
+
let(:redirected_parser) { Parser.new('http://www.redirect-example.com') }
|
10
|
+
|
11
|
+
it 'gets contents of an HTML tag' do
|
12
|
+
expect(og_parser.tag_contents 'title').to eq('Page title')
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'gets image src from selector' do
|
16
|
+
expect(og_parser.image_src('#first_image').first).to eq('image.jpg')
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'gets meta tags contents' do
|
20
|
+
expect(og_parser.meta_tag_contents "meta[@property='og:description']").to eq('Page Open Graph description')
|
21
|
+
expect(og_parser.meta_tag_contents "meta[name='description']").to eq('Page description')
|
22
|
+
expect(og_parser.meta_tag_contents_by_property 'og:description').to eq('Page Open Graph description')
|
23
|
+
expect(og_parser.meta_tag_contents_by_name 'description').to eq('Page description')
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'follows redirects' do
|
27
|
+
expect(redirected_parser.tag_contents 'title').to eq('Page title')
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module LinkPreviewer
|
4
|
+
class Previewer
|
5
|
+
|
6
|
+
describe Previewer do
|
7
|
+
|
8
|
+
let(:previewer) { Previewer.new('http://www.example.com') }
|
9
|
+
let(:previewer_twitter) { Previewer.new('http://www.twitter-tag-example.com') }
|
10
|
+
let(:previewer_open_graph) { Previewer.new('http://www.opengraph-example.com') }
|
11
|
+
|
12
|
+
describe '#title' do
|
13
|
+
it 'gets a meta tag title' do
|
14
|
+
expect(previewer.title).to eq('Page title')
|
15
|
+
end
|
16
|
+
it 'gives twitter tags higher priority on titles' do
|
17
|
+
expect(previewer_twitter.title).to eq('Page Twitter Tag title')
|
18
|
+
end
|
19
|
+
it 'gives opengraph tags even higher priority on titles' do
|
20
|
+
expect(previewer_open_graph.title).to eq('Page Open Graph title')
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
describe '#description' do
|
25
|
+
it 'gets a meta tag description' do
|
26
|
+
expect(previewer.description).to eq('Page description')
|
27
|
+
end
|
28
|
+
it 'gives twitter tags higher priority on descriptions' do
|
29
|
+
expect(previewer_twitter.description).to eq('Page Twitter Tag description')
|
30
|
+
end
|
31
|
+
it 'gives opengraph tags even higher priority on descriptions' do
|
32
|
+
expect(previewer_open_graph.description).to eq('Page Open Graph description')
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
describe '#images' do
|
37
|
+
it 'gives twitter tags high priority on images' do
|
38
|
+
expect(previewer_twitter.images.first).to eq('twitter-image.jpg')
|
39
|
+
end
|
40
|
+
it 'gives opengraph tags even higher priority on images' do
|
41
|
+
expect(previewer_open_graph.images.first).to eq('opengraph-image.jpg')
|
42
|
+
end
|
43
|
+
it 'previews webpages images' do
|
44
|
+
#expect(previewer.images.size).to eq(1)
|
45
|
+
#expect(previewer.images.first).to eq('image.jpg')
|
46
|
+
pending
|
47
|
+
fail
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'pry'
|
2
|
+
require 'webmock/rspec'
|
3
|
+
require 'link_previewer'
|
4
|
+
|
5
|
+
RSpec.configure do |config|
|
6
|
+
config.before(:each) do
|
7
|
+
stub_request(:get, 'www.example.com').to_return(status: 200, body: File.new('spec/fixtures/normal.html'))
|
8
|
+
stub_request(:get, 'www.twitter-tag-example.com').to_return(status: 200, body: File.new('spec/fixtures/twitter.html'))
|
9
|
+
stub_request(:get, 'www.opengraph-example.com').to_return(status: 200, body: File.new('spec/fixtures/opengraph.html'))
|
10
|
+
stub_request(:get, 'www.redirect-example.com').to_return(:status => 301, :headers => {'Location' => 'http://www.example.com'})
|
11
|
+
end
|
12
|
+
end
|
metadata
ADDED
@@ -0,0 +1,221 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: link_previewer
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1.alpha
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Lucas Polonio
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-09-11 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.5'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.5'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ! '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec-nc
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ! '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: guard
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ! '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ! '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: guard-rspec
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ! '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ! '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: pry
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ! '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ! '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: pry-remote
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ! '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ! '>='
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: pry-nav
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ! '>='
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ! '>='
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: nokogiri
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ! '>='
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ! '>='
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: webmock
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ! '>='
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ! '>='
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
description: A facebook-style link previewer (title, description and images).
|
168
|
+
email:
|
169
|
+
- polonio.lucas@gmail.com
|
170
|
+
executables: []
|
171
|
+
extensions: []
|
172
|
+
extra_rdoc_files: []
|
173
|
+
files:
|
174
|
+
- .gitignore
|
175
|
+
- .travis.yml
|
176
|
+
- Gemfile
|
177
|
+
- LICENSE.txt
|
178
|
+
- README.md
|
179
|
+
- Rakefile
|
180
|
+
- lib/link_previewer.rb
|
181
|
+
- lib/link_previewer/parser.rb
|
182
|
+
- lib/link_previewer/previewer.rb
|
183
|
+
- lib/link_previewer/version.rb
|
184
|
+
- link_previewer.gemspec
|
185
|
+
- spec/fixtures/normal.html
|
186
|
+
- spec/fixtures/opengraph.html
|
187
|
+
- spec/fixtures/twitter.html
|
188
|
+
- spec/parser_spec.rb
|
189
|
+
- spec/previewer_spec.rb
|
190
|
+
- spec/spec_helper.rb
|
191
|
+
homepage: ''
|
192
|
+
licenses:
|
193
|
+
- MIT
|
194
|
+
metadata: {}
|
195
|
+
post_install_message:
|
196
|
+
rdoc_options: []
|
197
|
+
require_paths:
|
198
|
+
- lib
|
199
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
200
|
+
requirements:
|
201
|
+
- - ! '>='
|
202
|
+
- !ruby/object:Gem::Version
|
203
|
+
version: '0'
|
204
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
205
|
+
requirements:
|
206
|
+
- - ! '>'
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: 1.3.1
|
209
|
+
requirements: []
|
210
|
+
rubyforge_project:
|
211
|
+
rubygems_version: 2.2.2
|
212
|
+
signing_key:
|
213
|
+
specification_version: 4
|
214
|
+
summary: A facebook-style link previewer.
|
215
|
+
test_files:
|
216
|
+
- spec/fixtures/normal.html
|
217
|
+
- spec/fixtures/opengraph.html
|
218
|
+
- spec/fixtures/twitter.html
|
219
|
+
- spec/parser_spec.rb
|
220
|
+
- spec/previewer_spec.rb
|
221
|
+
- spec/spec_helper.rb
|