kog 0.3.1
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.
- data/.document +5 -0
- data/.gitignore +21 -0
- data/LICENSE +20 -0
- data/README.rdoc +44 -0
- data/Rakefile +57 -0
- data/VERSION.yml +5 -0
- data/features/kog.feature +13 -0
- data/features/step_definitions/kog_steps.rb +15 -0
- data/features/support/env.rb +12 -0
- data/kog.gemspec +69 -0
- data/lib/kog.rb +8 -0
- data/lib/kog/object.rb +38 -0
- data/lib/kog/parser.rb +37 -0
- data/spec/kog/object/object_spec.rb +48 -0
- data/spec/kog/opengraph_spec.rb +9 -0
- data/spec/kog/parser/parser_spec.rb +32 -0
- data/spec/kog/xhtml/bad_data.xhtml +21 -0
- data/spec/kog/xhtml/good_data.xhtml +22 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +10 -0
- metadata +110 -0
data/.document
ADDED
data/.gitignore
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 John Wyles
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
= Kestrel Open Graph (kog)
|
2
|
+
|
3
|
+
This is a Ruby implementation of the OpenGraph protocol outlined by Facebook in {The Open Graph Protocol}[http://opengraphprotocol.org]. More information can be found here: {kog: A Ruby implementation of The Open Graph Protocol by Facebook}[http://johnwyles.com/2010/05/04/kog-a-ruby-implementation-of-the-open-graph-protocol-by-facebook/].
|
4
|
+
|
5
|
+
== Install
|
6
|
+
|
7
|
+
sudo gem install kog
|
8
|
+
|
9
|
+
== Usage
|
10
|
+
|
11
|
+
require 'rubygems'
|
12
|
+
require 'kog'
|
13
|
+
|
14
|
+
# Parse a resource and getting the resource
|
15
|
+
obj = OpenGraph::Parser.parse('http://www.rottentomatoes.com/m/office_space/')
|
16
|
+
puts obj.class # => OpenGraph::Object
|
17
|
+
|
18
|
+
# The object
|
19
|
+
puts obj.inspect # => #<OpenGraph::Object:0x101b01060 @image="http://images.rottentomatoes.com/images/movie/custom/aa/1087856aa.jpg", @title="Office Space", @url="http://www.rottentomatoes.com/m/office_space/", @site_name="Rotten Tomatoes", @type="movie">
|
20
|
+
|
21
|
+
# Accessors
|
22
|
+
puts obj.type # => movie
|
23
|
+
puts obj.type?('movie').inspect # => true
|
24
|
+
puts obj.type?('dog').inspect # => false
|
25
|
+
|
26
|
+
== Note on Patches/Pull Requests
|
27
|
+
|
28
|
+
* Fork the project.
|
29
|
+
* Make your feature addition or bug fix.
|
30
|
+
* Add tests for it. This is important so I don't break it in a
|
31
|
+
future version unintentionally.
|
32
|
+
* Commit, do not mess with rakefile, version, or history.
|
33
|
+
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
34
|
+
* Send me a pull request. Bonus points for topic branches.
|
35
|
+
|
36
|
+
== Credits
|
37
|
+
|
38
|
+
* John Wyles: Author
|
39
|
+
* Michael Bleigh: This project was loosely based off of Michael's original Ruby implementation
|
40
|
+
|
41
|
+
== Copyright
|
42
|
+
|
43
|
+
Copyright (c) 2010 John Wyles. See LICENSE for details.
|
44
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'jeweler'
|
6
|
+
Jeweler::Tasks.new do |gem|
|
7
|
+
gem.name = "kog"
|
8
|
+
gem.summary = %Q{A Ruby implementation of The Open Graph Protocol by Facebook}
|
9
|
+
gem.description = %Q{A Ruby implementation of The Open Graph Protocol by Facebook}
|
10
|
+
gem.email = "john@johnwyles.com"
|
11
|
+
gem.homepage = "http://github.com/johnwyles/kog"
|
12
|
+
gem.authors = ["John Wyles"]
|
13
|
+
gem.add_development_dependency "rspec", ">= 1.2.9"
|
14
|
+
gem.add_development_dependency "cucumber", ">= 0"
|
15
|
+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
16
|
+
end
|
17
|
+
Jeweler::GemcutterTasks.new
|
18
|
+
rescue LoadError
|
19
|
+
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
20
|
+
end
|
21
|
+
|
22
|
+
require 'spec/rake/spectask'
|
23
|
+
Spec::Rake::SpecTask.new(:spec) do |spec|
|
24
|
+
spec.libs << 'lib' << 'spec'
|
25
|
+
spec.spec_files = FileList['spec/**/*_spec.rb']
|
26
|
+
end
|
27
|
+
|
28
|
+
Spec::Rake::SpecTask.new(:rcov) do |spec|
|
29
|
+
spec.libs << 'lib' << 'spec'
|
30
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
31
|
+
spec.rcov = true
|
32
|
+
end
|
33
|
+
|
34
|
+
task :spec => :check_dependencies
|
35
|
+
|
36
|
+
begin
|
37
|
+
require 'cucumber/rake/task'
|
38
|
+
Cucumber::Rake::Task.new(:features)
|
39
|
+
|
40
|
+
task :features => :check_dependencies
|
41
|
+
rescue LoadError
|
42
|
+
task :features do
|
43
|
+
abort "Cucumber is not available. In order to run features, you must: sudo gem install cucumber"
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
task :default => :spec
|
48
|
+
|
49
|
+
require 'rake/rdoctask'
|
50
|
+
Rake::RDocTask.new do |rdoc|
|
51
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
52
|
+
|
53
|
+
rdoc.rdoc_dir = 'rdoc'
|
54
|
+
rdoc.title = "kog #{version}"
|
55
|
+
rdoc.rdoc_files.include('README*')
|
56
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
57
|
+
end
|
data/VERSION.yml
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
Feature:
|
2
|
+
kog should allow me
|
3
|
+
As a person
|
4
|
+
To parse resources for their meanings
|
5
|
+
|
6
|
+
Scenario Outline: Parse
|
7
|
+
Given that I have the URL <url>
|
8
|
+
When I parse it for <field>
|
9
|
+
Then I expect to <result>
|
10
|
+
Examples:
|
11
|
+
| url | field | result |
|
12
|
+
| http://example.com/good/data/123 | "type" | see "band" |
|
13
|
+
| http://example.com/good/data/123 | "title" | see "Foo" |
|
@@ -0,0 +1,15 @@
|
|
1
|
+
Given /^that I have the URL (.*)$/ do |url|
|
2
|
+
@url = url
|
3
|
+
good_data = File.open(File.dirname(__FILE__) + '/../../spec/kog/xhtml/good_data.xhtml').read
|
4
|
+
FakeWeb.register_uri(:get, @url, :body => good_data)
|
5
|
+
end
|
6
|
+
|
7
|
+
When /^I parse it for "([^\"]*)"$/ do |field|
|
8
|
+
@field = field
|
9
|
+
@body = OpenGraph::Parser.parse(@url)
|
10
|
+
@body.should_not be_nil
|
11
|
+
end
|
12
|
+
|
13
|
+
Then /^I expect to see "([^\"]*)"$/ do |result|
|
14
|
+
@body.send("#{@field}").should == result
|
15
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# Cucumber
|
2
|
+
require 'cucumber/formatter/unicode'
|
3
|
+
$KCODE = 'u' unless Cucumber::RUBY_1_9
|
4
|
+
|
5
|
+
# Fakeweb
|
6
|
+
require 'fakeweb'
|
7
|
+
|
8
|
+
# rSpec
|
9
|
+
require File.expand_path(File.dirname(__FILE__) + "/../../spec/spec_helper")
|
10
|
+
|
11
|
+
# Kestrel_OpenGraph
|
12
|
+
require 'kog'
|
data/kog.gemspec
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{kog}
|
8
|
+
s.version = "0.3.1"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["John Wyles"]
|
12
|
+
s.date = %q{2010-05-04}
|
13
|
+
s.description = %q{A Ruby implementation of The Open Graph Protocol by Facebook}
|
14
|
+
s.email = %q{john@johnwyles.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".gitignore",
|
22
|
+
"LICENSE",
|
23
|
+
"README.rdoc",
|
24
|
+
"Rakefile",
|
25
|
+
"VERSION.yml",
|
26
|
+
"features/kog.feature",
|
27
|
+
"features/step_definitions/kog_steps.rb",
|
28
|
+
"features/support/env.rb",
|
29
|
+
"kog.gemspec",
|
30
|
+
"lib/kog.rb",
|
31
|
+
"lib/kog/object.rb",
|
32
|
+
"lib/kog/parser.rb",
|
33
|
+
"spec/kog/object/object_spec.rb",
|
34
|
+
"spec/kog/opengraph_spec.rb",
|
35
|
+
"spec/kog/parser/parser_spec.rb",
|
36
|
+
"spec/kog/xhtml/bad_data.xhtml",
|
37
|
+
"spec/kog/xhtml/good_data.xhtml",
|
38
|
+
"spec/spec.opts",
|
39
|
+
"spec/spec_helper.rb"
|
40
|
+
]
|
41
|
+
s.homepage = %q{http://github.com/johnwyles/kog}
|
42
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
43
|
+
s.require_paths = ["lib"]
|
44
|
+
s.rubygems_version = %q{1.3.6}
|
45
|
+
s.summary = %q{A Ruby implementation of The Open Graph Protocol by Facebook}
|
46
|
+
s.test_files = [
|
47
|
+
"spec/kog/object/object_spec.rb",
|
48
|
+
"spec/kog/opengraph_spec.rb",
|
49
|
+
"spec/kog/parser/parser_spec.rb",
|
50
|
+
"spec/spec_helper.rb"
|
51
|
+
]
|
52
|
+
|
53
|
+
if s.respond_to? :specification_version then
|
54
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
55
|
+
s.specification_version = 3
|
56
|
+
|
57
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
58
|
+
s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
|
59
|
+
s.add_development_dependency(%q<cucumber>, [">= 0"])
|
60
|
+
else
|
61
|
+
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
62
|
+
s.add_dependency(%q<cucumber>, [">= 0"])
|
63
|
+
end
|
64
|
+
else
|
65
|
+
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
66
|
+
s.add_dependency(%q<cucumber>, [">= 0"])
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
data/lib/kog.rb
ADDED
data/lib/kog/object.rb
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
module OpenGraph
|
2
|
+
class Object
|
3
|
+
# Define the types specified in the OpenGraph protocol
|
4
|
+
STANDARD_TYPES = {
|
5
|
+
'activity' => %w(activity sport),
|
6
|
+
'business' => %w(bar company cafe hotel restaurant),
|
7
|
+
'group' => %w(cause sports_league sports_team),
|
8
|
+
'organization' => %w(band government non_profit school university),
|
9
|
+
'person' => %w(actor athlete author director musician politician public_figure),
|
10
|
+
'place' => %w(city country landmark state_province),
|
11
|
+
'product' => %w(album book drink food game movie product song tv_show),
|
12
|
+
'website' => %w(blog website)
|
13
|
+
}
|
14
|
+
|
15
|
+
# Create methods for each attribute (including the soon-to-be-deprecated "type" attribute)
|
16
|
+
def initialize(hash)
|
17
|
+
hash.each do |key, value|
|
18
|
+
unless (self.respond_to?(key) && key != 'type')
|
19
|
+
# Assign an instance variable to the value
|
20
|
+
instance_variable_set("@#{key}", value)
|
21
|
+
|
22
|
+
# Define accessors to the instance variable
|
23
|
+
object = class << self; self; end
|
24
|
+
object.send(:define_method, key) { hash[key] }
|
25
|
+
object.send(:define_method, "#{key}?") { |type| hash[key] == type }
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
# The schema this object belongs to
|
31
|
+
def schema
|
32
|
+
STANDARD_TYPES.each_pair do |schema, types|
|
33
|
+
return schema if types.include?(self.type)
|
34
|
+
end
|
35
|
+
return nil
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
data/lib/kog/parser.rb
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'nokogiri'
|
2
|
+
require 'httparty'
|
3
|
+
|
4
|
+
module OpenGraph
|
5
|
+
module Parser
|
6
|
+
# Attributes that must be present according to the protocol
|
7
|
+
REQUIRED_ATTRIBUTES = ['image', 'title', 'type', 'url']
|
8
|
+
|
9
|
+
# Parse
|
10
|
+
def self.parse(url)
|
11
|
+
# Get the document
|
12
|
+
begin
|
13
|
+
body = HTTParty.get(url).body
|
14
|
+
doc = Nokogiri::HTML.parse(body)
|
15
|
+
rescue HTTParty::ResponseError, HTTParty::UnsupportedURIScheme, HTTParty::UnsupportedFormat,
|
16
|
+
URI::InvalidURIError, SocketError
|
17
|
+
return nil
|
18
|
+
end
|
19
|
+
|
20
|
+
# Initialize the temporary hash
|
21
|
+
type = Hash.new
|
22
|
+
|
23
|
+
# Parse the document and append to the temporary hash
|
24
|
+
doc.css('meta').each do |meta|
|
25
|
+
if !meta.attribute('property').nil? && meta.attribute('property').to_s.match(/^og:(.+)$/i)
|
26
|
+
type[$1.gsub('-','_')] = meta.attribute('content').to_s
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
# None of the required attributes were found
|
31
|
+
REQUIRED_ATTRIBUTES.each { |key| return nil if !type.has_key?(key) }
|
32
|
+
|
33
|
+
# Return the representative OpenGraph object
|
34
|
+
return OpenGraph::Object.new(type)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'spec_helper'))
|
2
|
+
require 'kog'
|
3
|
+
|
4
|
+
describe 'OpenGraph' do
|
5
|
+
describe 'Object' do
|
6
|
+
before(:each) do
|
7
|
+
hash = {
|
8
|
+
'title' => 'Foo',
|
9
|
+
'url' => 'http://example.com/foo/',
|
10
|
+
'type' => 'band',
|
11
|
+
'image' => 'http://example.com/foo/foo.jpg',
|
12
|
+
'foo' => 'bar'
|
13
|
+
}
|
14
|
+
@data = OpenGraph::Object.new(hash)
|
15
|
+
end
|
16
|
+
|
17
|
+
describe '.schema' do
|
18
|
+
it 'should give the full schema for the type' do
|
19
|
+
@data.schema.should == 'organization'
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
describe '.type' do
|
24
|
+
it 'should return the type specified for it' do
|
25
|
+
@data.type.should == 'band'
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
describe '.type?' do
|
30
|
+
it 'should return the type specified for it' do
|
31
|
+
@data.type?('band').should be_true
|
32
|
+
@data.type?('movie').should be_false
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
describe '.title' do
|
37
|
+
it 'should return the title specified for it' do
|
38
|
+
@data.title.should == 'Foo'
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
describe '.foo' do
|
43
|
+
it 'should return the foo specified for it' do
|
44
|
+
@data.foo.should == 'bar'
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'spec_helper'))
|
2
|
+
require 'kog'
|
3
|
+
|
4
|
+
describe 'OpenGraph' do
|
5
|
+
describe 'Parser' do
|
6
|
+
before(:each) do
|
7
|
+
good_data = File.open(File.dirname(__FILE__) + '/../xhtml/good_data.xhtml').read
|
8
|
+
bad_data = File.open(File.dirname(__FILE__) + '/../xhtml/bad_data.xhtml').read
|
9
|
+
FakeWeb.register_uri(:get, 'http://example.com/good/data/123', :body => good_data)
|
10
|
+
FakeWeb.register_uri(:get, 'http://example.com/bad/data/123', :body => bad_data)
|
11
|
+
end
|
12
|
+
|
13
|
+
describe '.parse' do
|
14
|
+
it 'should return nil if the URL is invalid' do
|
15
|
+
OpenGraph::Parser.parse('bad://!#*@badurl.com/bad/data!/123').should be_nil
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'should return nil if the required attributes are missing or invalid' do
|
19
|
+
OpenGraph::Parser.parse('http://example.com/bad/data/123').should be_nil
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'should return an OpenGraph::Type instance if the required attributes are present and valid' do
|
23
|
+
OpenGraph::Parser.parse('http://example.com/good/data/123').should be_instance_of(OpenGraph::Object)
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'should return a valid title if the attributes are present and valid' do
|
27
|
+
data = OpenGraph::Parser.parse('http://example.com/good/data/123')
|
28
|
+
data.title.should == 'Foo'
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://opengraphprotocol.org/schema/" lang="en" id="website">
|
3
|
+
<head>
|
4
|
+
<title>Foo</title>
|
5
|
+
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
|
6
|
+
<meta name="title" content="Foo">
|
7
|
+
<meta name="description" content="Foo" />
|
8
|
+
<meta name="keywords" content="Foo, Bar, Example" />
|
9
|
+
<link href="http://example.com/foo/" rel="canonical">
|
10
|
+
<link rel="image_src" href="http://example.com/foo/foo.jpg" />
|
11
|
+
<link rel="stylesheet" type="text/css" media="screen" href="http://example.com/foo/foo.css" />
|
12
|
+
<link rel="icon" href="http://example.com/foo/favicon.ico" />
|
13
|
+
<link rel="apple-touch-icon" href="http://example.com/foo/foo.png" />
|
14
|
+
<meta property="og:image" content="http://example.com/foo/foo.jpg" />
|
15
|
+
<meta property="og:type" content="band" />
|
16
|
+
</head>
|
17
|
+
<body>
|
18
|
+
<h1>Foo</h1>
|
19
|
+
</body>
|
20
|
+
</html>
|
21
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://opengraphprotocol.org/schema/" lang="en" id="website">
|
3
|
+
<head>
|
4
|
+
<title>Foo</title>
|
5
|
+
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
|
6
|
+
<meta name="title" content="Foo">
|
7
|
+
<meta name="description" content="Foo" />
|
8
|
+
<meta name="keywords" content="Foo, Bar, Example" />
|
9
|
+
<link href="http://example.com/foo/" rel="canonical">
|
10
|
+
<link rel="image_src" href="http://example.com/foo/foo.jpg" />
|
11
|
+
<link rel="stylesheet" type="text/css" media="screen" href="http://example.com/foo/foo.css" />
|
12
|
+
<link rel="icon" href="http://example.com/foo/favicon.ico" />
|
13
|
+
<link rel="apple-touch-icon" href="http://example.com/foo/foo.png" />
|
14
|
+
<meta property="og:image" content="http://example.com/foo/foo.jpg" />
|
15
|
+
<meta property="og:title" content="Foo" />
|
16
|
+
<meta property="og:type" content="band" />
|
17
|
+
<meta property="og:url" content="http://example.com/foo/" />
|
18
|
+
</head>
|
19
|
+
<body>
|
20
|
+
<h1>Foo</h1>
|
21
|
+
</body>
|
22
|
+
</html>
|
data/spec/spec.opts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,110 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: kog
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 3
|
8
|
+
- 1
|
9
|
+
version: 0.3.1
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- John Wyles
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2010-05-04 00:00:00 -07:00
|
18
|
+
default_executable:
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: rspec
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 1
|
29
|
+
- 2
|
30
|
+
- 9
|
31
|
+
version: 1.2.9
|
32
|
+
type: :development
|
33
|
+
version_requirements: *id001
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
name: cucumber
|
36
|
+
prerelease: false
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
segments:
|
42
|
+
- 0
|
43
|
+
version: "0"
|
44
|
+
type: :development
|
45
|
+
version_requirements: *id002
|
46
|
+
description: A Ruby implementation of The Open Graph Protocol by Facebook
|
47
|
+
email: john@johnwyles.com
|
48
|
+
executables: []
|
49
|
+
|
50
|
+
extensions: []
|
51
|
+
|
52
|
+
extra_rdoc_files:
|
53
|
+
- LICENSE
|
54
|
+
- README.rdoc
|
55
|
+
files:
|
56
|
+
- .document
|
57
|
+
- .gitignore
|
58
|
+
- LICENSE
|
59
|
+
- README.rdoc
|
60
|
+
- Rakefile
|
61
|
+
- VERSION.yml
|
62
|
+
- features/kog.feature
|
63
|
+
- features/step_definitions/kog_steps.rb
|
64
|
+
- features/support/env.rb
|
65
|
+
- kog.gemspec
|
66
|
+
- lib/kog.rb
|
67
|
+
- lib/kog/object.rb
|
68
|
+
- lib/kog/parser.rb
|
69
|
+
- spec/kog/object/object_spec.rb
|
70
|
+
- spec/kog/opengraph_spec.rb
|
71
|
+
- spec/kog/parser/parser_spec.rb
|
72
|
+
- spec/kog/xhtml/bad_data.xhtml
|
73
|
+
- spec/kog/xhtml/good_data.xhtml
|
74
|
+
- spec/spec.opts
|
75
|
+
- spec/spec_helper.rb
|
76
|
+
has_rdoc: true
|
77
|
+
homepage: http://github.com/johnwyles/kog
|
78
|
+
licenses: []
|
79
|
+
|
80
|
+
post_install_message:
|
81
|
+
rdoc_options:
|
82
|
+
- --charset=UTF-8
|
83
|
+
require_paths:
|
84
|
+
- lib
|
85
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
segments:
|
90
|
+
- 0
|
91
|
+
version: "0"
|
92
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
segments:
|
97
|
+
- 0
|
98
|
+
version: "0"
|
99
|
+
requirements: []
|
100
|
+
|
101
|
+
rubyforge_project:
|
102
|
+
rubygems_version: 1.3.6
|
103
|
+
signing_key:
|
104
|
+
specification_version: 3
|
105
|
+
summary: A Ruby implementation of The Open Graph Protocol by Facebook
|
106
|
+
test_files:
|
107
|
+
- spec/kog/object/object_spec.rb
|
108
|
+
- spec/kog/opengraph_spec.rb
|
109
|
+
- spec/kog/parser/parser_spec.rb
|
110
|
+
- spec/spec_helper.rb
|