open_graph_reader 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +7 -0
  2. data/.gitmodules +3 -0
  3. data/.rspec +2 -0
  4. data/.yardopts +1 -0
  5. data/lib/open_graph_reader.rb +83 -0
  6. data/lib/open_graph_reader/base.rb +57 -0
  7. data/lib/open_graph_reader/builder.rb +100 -0
  8. data/lib/open_graph_reader/definitions.rb +333 -0
  9. data/lib/open_graph_reader/fetcher.rb +82 -0
  10. data/lib/open_graph_reader/object.rb +95 -0
  11. data/lib/open_graph_reader/object/dsl.rb +130 -0
  12. data/lib/open_graph_reader/object/dsl/types.rb +71 -0
  13. data/lib/open_graph_reader/object/registry.rb +54 -0
  14. data/lib/open_graph_reader/parser.rb +85 -0
  15. data/lib/open_graph_reader/parser/graph.rb +136 -0
  16. data/lib/open_graph_reader/version.rb +4 -0
  17. data/spec/fixtures/examples/apple-touch-icon-precomposed.png +0 -0
  18. data/spec/fixtures/examples/apple-touch-icon.png +0 -0
  19. data/spec/fixtures/examples/article-offset.html +25 -0
  20. data/spec/fixtures/examples/article-utc.html +25 -0
  21. data/spec/fixtures/examples/article.html +25 -0
  22. data/spec/fixtures/examples/audio-array.html +27 -0
  23. data/spec/fixtures/examples/audio-url.html +25 -0
  24. data/spec/fixtures/examples/audio.html +24 -0
  25. data/spec/fixtures/examples/book-isbn10.html +27 -0
  26. data/spec/fixtures/examples/book.html +27 -0
  27. data/spec/fixtures/examples/canadian.html +16 -0
  28. data/spec/fixtures/examples/error.html +17 -0
  29. data/spec/fixtures/examples/errors/article-date.html +25 -0
  30. data/spec/fixtures/examples/errors/book-author.html +27 -0
  31. data/spec/fixtures/examples/errors/book.html +27 -0
  32. data/spec/fixtures/examples/errors/gender.html +20 -0
  33. data/spec/fixtures/examples/errors/geo.html +23 -0
  34. data/spec/fixtures/examples/errors/type.html +16 -0
  35. data/spec/fixtures/examples/errors/video-duration.html +42 -0
  36. data/spec/fixtures/examples/favicon.ico +0 -0
  37. data/spec/fixtures/examples/filters/xss-image.html +15 -0
  38. data/spec/fixtures/examples/image-array.html +26 -0
  39. data/spec/fixtures/examples/image-toosmall.html +24 -0
  40. data/spec/fixtures/examples/image-url.html +22 -0
  41. data/spec/fixtures/examples/image.html +21 -0
  42. data/spec/fixtures/examples/index.html +67 -0
  43. data/spec/fixtures/examples/media/audio/1khz.mp3 +0 -0
  44. data/spec/fixtures/examples/media/audio/250hz.mp3 +0 -0
  45. data/spec/fixtures/examples/media/images/1.png +0 -0
  46. data/spec/fixtures/examples/media/images/50.png +0 -0
  47. data/spec/fixtures/examples/media/images/75.png +0 -0
  48. data/spec/fixtures/examples/media/images/icon.png +0 -0
  49. data/spec/fixtures/examples/media/images/logo.png +0 -0
  50. data/spec/fixtures/examples/media/images/train.jpg +0 -0
  51. data/spec/fixtures/examples/media/video/train.flv +0 -0
  52. data/spec/fixtures/examples/media/video/train.mp4 +0 -0
  53. data/spec/fixtures/examples/media/video/train.webm +0 -0
  54. data/spec/fixtures/examples/min.html +14 -0
  55. data/spec/fixtures/examples/nomedia.html +20 -0
  56. data/spec/fixtures/examples/plain.html +10 -0
  57. data/spec/fixtures/examples/profile.html +25 -0
  58. data/spec/fixtures/examples/required.html +20 -0
  59. data/spec/fixtures/examples/robots.txt +4 -0
  60. data/spec/fixtures/examples/sitemap.xml +23 -0
  61. data/spec/fixtures/examples/video-array.html +36 -0
  62. data/spec/fixtures/examples/video-movie.html +42 -0
  63. data/spec/fixtures/examples/video.html +26 -0
  64. data/spec/integration/invalid_examples_spec.rb +69 -0
  65. data/spec/integration/valid_examples_spec.rb +76 -0
  66. data/spec/open_graph_reader_spec.rb +94 -0
  67. data/spec/spec_helper.rb +35 -0
  68. metadata +247 -0
@@ -0,0 +1,136 @@
1
+ require 'forwardable'
2
+
3
+ module OpenGraphReader
4
+ class Parser
5
+ # A Graph to represent OpenGraph tags.
6
+ class Graph
7
+ # A node in the graph.
8
+ Node = Struct.new(:name, :content) do
9
+ extend Forwardable
10
+ include Enumerable
11
+
12
+ # The parent node.
13
+ #
14
+ # @return [Node, nil]
15
+ attr_accessor :parent
16
+
17
+ # @!method empty?
18
+ # Does this node have any children?
19
+ #
20
+ # @return [Bool]
21
+ def_delegators :children, :empty?
22
+
23
+ # Children of this node.
24
+ def children
25
+ @children ||= []
26
+ end
27
+
28
+ # Iterate over all children.
29
+ #
30
+ # @yield [Node]
31
+ def each(&block)
32
+ children.each do |child|
33
+ yield child
34
+ child.each(&block)
35
+ end
36
+ end
37
+
38
+ # Add children.
39
+ #
40
+ # @param [Node] node
41
+ def << node
42
+ node.parent = self
43
+ children << node
44
+ end
45
+
46
+ # Get node's namespace.
47
+ #
48
+ # @return [String]
49
+ def namespace
50
+ parent.fullname if parent
51
+ end
52
+
53
+ # Get node's namespace as array.
54
+ #
55
+ # @return [Array<String>]
56
+ def path
57
+ @path ||= fullname.split(':')
58
+ end
59
+
60
+ # Get node's full name.
61
+ #
62
+ # @return [String]
63
+ def fullname
64
+ @fullname ||= [namespace, name].compact.join(':')
65
+ @fullname unless @fullname.empty?
66
+ end
67
+ end
68
+
69
+ extend Forwardable
70
+ include Enumerable
71
+
72
+ # The initial node.
73
+ #
74
+ # @return [Node, nil]
75
+ attr_reader :root
76
+
77
+ # @!method empty?
78
+ # Does this graph have any nodes?
79
+ #
80
+ # @return [Bool]
81
+ def_delegators :root, :empty?
82
+
83
+
84
+ # Create new graph.
85
+ def initialize
86
+ @root = Node.new
87
+ end
88
+
89
+ # Iterate through all nodes that have a value.
90
+ #
91
+ # @yield [Node]
92
+ def each
93
+ root.each do |child|
94
+ yield child if child.content
95
+ end
96
+ end
97
+
98
+ # Fetch first node's value.
99
+ #
100
+ # @param [String] property The fully qualified name, for example <tt>og:type</tt>.
101
+ # @param [String] default The default in case the a value is not found.
102
+ # @yield Return a default in case the value is not found. Supersedes the default parameter.
103
+ # @return [String, Bool, Integer, Float, DateTime, nil]
104
+ def fetch property, default=nil
105
+ node = find_by(property)
106
+ return yield if node.nil? && block_given?
107
+ return default if node.nil?
108
+ node.content
109
+ end
110
+
111
+ # Fetch first node
112
+ #
113
+ # @param [String] property The fully qualified name, for example <tt>og:type</tt>.
114
+ # @return [Node, nil]
115
+ def find_by property
116
+ property = normalize_property property
117
+ find {|node| node.fullname == property }
118
+ end
119
+
120
+ # Fetch all nodes
121
+ #
122
+ # @param [String] property The fully qualified name, for example <tt>og:type</tt>.
123
+ # @return [Array<Node>]
124
+ def select_by property
125
+ property = normalize_property property
126
+ select {|node| node.fullname == property }
127
+ end
128
+
129
+ private
130
+
131
+ def normalize_property property
132
+ property.is_a?(Enumerable) ? property.join(':') : property
133
+ end
134
+ end
135
+ end
136
+ end
@@ -0,0 +1,4 @@
1
+ module OpenGraphReader
2
+ # Tbe library version
3
+ VERSION = "0.1.0"
4
+ end
@@ -0,0 +1,25 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head prefix="og: http://ogp.me/ns# article: http://ogp.me/ns/article#">
4
+ <meta charset="utf-8">
5
+ <title>5 Held in Plot to Bug Office</title>
6
+ <meta property="og:title" content="5 Held in Plot to Bug Office">
7
+ <meta property="og:site_name" content="Open Graph protocol examples">
8
+ <meta property="og:type" content="article">
9
+ <meta property="og:locale" content="en_US">
10
+ <link rel="canonical" href="http://examples.opengraphprotocol.us/article-offset.html">
11
+ <meta property="og:url" content="http://examples.opengraphprotocol.us/article-offset.html">
12
+ <meta property="og:image" content="http://examples.opengraphprotocol.us/media/images/50.png">
13
+ <meta property="og:image:secure_url" content="https://d72cgtgi6hvvl.cloudfront.net/media/images/50.png">
14
+ <meta property="og:image:width" content="50">
15
+ <meta property="og:image:height" content="50">
16
+ <meta property="og:image:type" content="image/png">
17
+ <meta property="article:published_time" content="1972-06-17T20:23:45-05:00">
18
+ <meta property="article:author" content="http://examples.opengraphprotocol.us/profile.html">
19
+ <meta property="article:section" content="Front page">
20
+ <meta property="article:tag" content="Watergate">
21
+ </head>
22
+ <body>
23
+ <p>Example of an <a href="http://ogp.me/#type_article">article</a> object with an ISO 8601 formatted date and time component a UTC offset in the format hh:mm.</p>
24
+ </body>
25
+ </html>
@@ -0,0 +1,25 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head prefix="og: http://ogp.me/ns# article: http://ogp.me/ns/article#">
4
+ <meta charset="utf-8">
5
+ <title>5 Held in Plot to Bug Office</title>
6
+ <meta property="og:title" content="5 Held in Plot to Bug Office">
7
+ <meta property="og:site_name" content="Open Graph protocol examples">
8
+ <meta property="og:type" content="article">
9
+ <meta property="og:locale" content="en_US">
10
+ <link rel="canonical" href="http://examples.opengraphprotocol.us/article-utc.html">
11
+ <meta property="og:url" content="http://examples.opengraphprotocol.us/article-utc.html">
12
+ <meta property="og:image" content="http://examples.opengraphprotocol.us/media/images/50.png">
13
+ <meta property="og:image:secure_url" content="https://d72cgtgi6hvvl.cloudfront.net/media/images/50.png">
14
+ <meta property="og:image:width" content="50">
15
+ <meta property="og:image:height" content="50">
16
+ <meta property="og:image:type" content="image/png">
17
+ <meta property="article:published_time" content="1972-06-18T01:23:45Z">
18
+ <meta property="article:author" content="http://examples.opengraphprotocol.us/profile.html">
19
+ <meta property="article:section" content="Front page">
20
+ <meta property="article:tag" content="Watergate">
21
+ </head>
22
+ <body>
23
+ <p>Example of an <a href="http://ogp.me/#type_article">article</a> object with an ISO 8601 formatted date and time component using the "Z" timezone designator for UTC.</p>
24
+ </body>
25
+ </html>
@@ -0,0 +1,25 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head prefix="og: http://ogp.me/ns# article: http://ogp.me/ns/article#">
4
+ <meta charset="utf-8">
5
+ <title>5 Held in Plot to Bug Office</title>
6
+ <meta property="og:title" content="5 Held in Plot to Bug Office">
7
+ <meta property="og:site_name" content="Open Graph protocol examples">
8
+ <meta property="og:type" content="article">
9
+ <meta property="og:locale" content="en_US">
10
+ <link rel="canonical" href="http://examples.opengraphprotocol.us/article.html">
11
+ <meta property="og:url" content="http://examples.opengraphprotocol.us/article.html">
12
+ <meta property="og:image" content="http://examples.opengraphprotocol.us/media/images/50.png">
13
+ <meta property="og:image:secure_url" content="https://d72cgtgi6hvvl.cloudfront.net/media/images/50.png">
14
+ <meta property="og:image:width" content="50">
15
+ <meta property="og:image:height" content="50">
16
+ <meta property="og:image:type" content="image/png">
17
+ <meta property="article:published_time" content="1972-06-18">
18
+ <meta property="article:author" content="http://examples.opengraphprotocol.us/profile.html">
19
+ <meta property="article:section" content="Front page">
20
+ <meta property="article:tag" content="Watergate">
21
+ </head>
22
+ <body>
23
+ <p>Example of an <a href="http://ogp.me/#type_article">article</a> object.</p>
24
+ </body>
25
+ </html>
@@ -0,0 +1,27 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head prefix="og: http://ogp.me/ns#">
4
+ <meta charset="utf-8">
5
+ <title>Two structured audio properties</title>
6
+ <meta property="og:title" content="Two structured audio properties">
7
+ <meta property="og:site_name" content="Open Graph protocol examples">
8
+ <meta property="og:type" content="website">
9
+ <meta property="og:locale" content="en_US">
10
+ <link rel="canonical" href="http://examples.opengraphprotocol.us/audio-array.html">
11
+ <meta property="og:url" content="http://examples.opengraphprotocol.us/audio-array.html">
12
+ <meta property="og:image" content="http://examples.opengraphprotocol.us/media/images/50.png">
13
+ <meta property="og:image:secure_url" content="https://d72cgtgi6hvvl.cloudfront.net/media/images/50.png">
14
+ <meta property="og:image:width" content="50">
15
+ <meta property="og:image:height" content="50">
16
+ <meta property="og:image:type" content="image/png">
17
+ <meta property="og:audio" content="http://examples.opengraphprotocol.us/media/audio/1khz.mp3">
18
+ <meta property="og:audio:secure_url" content="https://d72cgtgi6hvvl.cloudfront.net/media/audio/1khz.mp3">
19
+ <meta property="og:audio:type" content="audio/mpeg">
20
+ <meta property="og:audio" content="http://examples.opengraphprotocol.us/media/audio/250hz.mp3">
21
+ <meta property="og:audio:secure_url" content="https://d72cgtgi6hvvl.cloudfront.net/media/audio/250hz.mp3">
22
+ <meta property="og:audio:type" content="audio/mpeg">
23
+ </head>
24
+ <body>
25
+ <p>Audio property with type declaration as structured property.</p>
26
+ </body>
27
+ </html>
@@ -0,0 +1,25 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head prefix="og: http://ogp.me/ns#">
4
+ <meta charset="utf-8">
5
+ <title>Structured audio property</title>
6
+ <meta property="og:title" content="Structured audio property">
7
+ <meta property="og:site_name" content="Open Graph protocol examples">
8
+ <meta property="og:type" content="website">
9
+ <meta property="og:locale" content="en_US">
10
+ <link rel="canonical" href="http://examples.opengraphprotocol.us/audio-url.html">
11
+ <meta property="og:url" content="http://examples.opengraphprotocol.us/audio-url.html">
12
+ <meta property="og:image" content="http://examples.opengraphprotocol.us/media/images/50.png">
13
+ <meta property="og:image:secure_url" content="https://d72cgtgi6hvvl.cloudfront.net/media/images/50.png">
14
+ <meta property="og:image:width" content="50">
15
+ <meta property="og:image:height" content="50">
16
+ <meta property="og:image:type" content="image/png">
17
+ <meta property="og:audio:url" content="http://examples.opengraphprotocol.us/media/audio/250hz.mp3">
18
+ <meta property="og:audio:secure_url" content="https://d72cgtgi6hvvl.cloudfront.net/media/audio/250hz.mp3">
19
+ <meta property="og:audio:type" content="audio/mpeg">
20
+ </head>
21
+ <body>
22
+ <p>Audio defined as structured properties.</p>
23
+ <p>Compare to <a href="/audio.html">og:audio alias</a> for parser support of og:audio:url vs. og:audio.</p>
24
+ </body>
25
+ </html>
@@ -0,0 +1,24 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head prefix="og: http://ogp.me/ns#">
4
+ <meta charset="utf-8">
5
+ <title>Structured audio property</title>
6
+ <meta property="og:title" content="Structured audio property">
7
+ <meta property="og:site_name" content="Open Graph protocol examples">
8
+ <meta property="og:type" content="website">
9
+ <meta property="og:locale" content="en_US">
10
+ <link rel="canonical" href="http://examples.opengraphprotocol.us/audio.html">
11
+ <meta property="og:url" content="http://examples.opengraphprotocol.us/audio.html">
12
+ <meta property="og:image" content="http://examples.opengraphprotocol.us/media/images/50.png">
13
+ <meta property="og:image:secure_url" content="https://d72cgtgi6hvvl.cloudfront.net/media/images/50.png">
14
+ <meta property="og:image:width" content="50">
15
+ <meta property="og:image:height" content="50">
16
+ <meta property="og:image:type" content="image/png">
17
+ <meta property="og:audio" content="http://examples.opengraphprotocol.us/media/audio/250hz.mp3">
18
+ <meta property="og:audio:secure_url" content="https://d72cgtgi6hvvl.cloudfront.net/media/audio/250hz.mp3">
19
+ <meta property="og:audio:type" content="audio/mpeg">
20
+ </head>
21
+ <body>
22
+ <p>Audio property with type declaration as structured property.</p>
23
+ </body>
24
+ </html>
@@ -0,0 +1,27 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head prefix="og: http://ogp.me/ns# book: http://ogp.me/ns/book#">
4
+ <meta charset="utf-8">
5
+ <title>Steve Jobs</title>
6
+ <meta property="og:title" content="Steve Jobs">
7
+ <meta property="og:site_name" content="Open Graph protocol examples">
8
+ <meta property="og:type" content="book">
9
+ <meta property="og:locale" content="en_US">
10
+ <link rel="canonical" href="http://examples.opengraphprotocol.us/book-isbn10.html">
11
+ <meta property="og:url" content="http://examples.opengraphprotocol.us/book-isbn10.html">
12
+ <meta property="og:image" content="http://examples.opengraphprotocol.us/media/images/50.png">
13
+ <meta property="og:image:secure_url" content="https://d72cgtgi6hvvl.cloudfront.net/media/images/50.png">
14
+ <meta property="og:image:width" content="50">
15
+ <meta property="og:image:height" content="50">
16
+ <meta property="og:image:type" content="image/png">
17
+ <meta property="book:author" content="http://examples.opengraphprotocol.us/profile.html">
18
+ <meta property="book:isbn" content="1451648537">
19
+ <meta property="book:release_date" content="2011-10-24">
20
+ <meta property="book:tag" content="Steve Jobs">
21
+ <meta property="book:tag" content="Apple">
22
+ <meta property="book:tag" content="Pixar">
23
+ </head>
24
+ <body>
25
+ <p>Example of a <a href="http://ogp.me/#type_book">book</a> object with an ISBN-10.</p>
26
+ </body>
27
+ </html>
@@ -0,0 +1,27 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head prefix="og: http://ogp.me/ns# book: http://ogp.me/ns/book#">
4
+ <meta charset="utf-8">
5
+ <title>Steve Jobs</title>
6
+ <meta property="og:title" content="Steve Jobs">
7
+ <meta property="og:site_name" content="Open Graph protocol examples">
8
+ <meta property="og:type" content="book">
9
+ <meta property="og:locale" content="en_US">
10
+ <link rel="canonical" href="http://examples.opengraphprotocol.us/book.html">
11
+ <meta property="og:url" content="http://examples.opengraphprotocol.us/book.html">
12
+ <meta property="og:image" content="http://examples.opengraphprotocol.us/media/images/50.png">
13
+ <meta property="og:image:secure_url" content="https://d72cgtgi6hvvl.cloudfront.net/media/images/50.png">
14
+ <meta property="og:image:width" content="50">
15
+ <meta property="og:image:height" content="50">
16
+ <meta property="og:image:type" content="image/png">
17
+ <meta property="book:author" content="http://examples.opengraphprotocol.us/profile.html">
18
+ <meta property="book:isbn" content="978-1451648539">
19
+ <meta property="book:release_date" content="2011-10-24">
20
+ <meta property="book:tag" content="Steve Jobs">
21
+ <meta property="book:tag" content="Apple">
22
+ <meta property="book:tag" content="Pixar">
23
+ </head>
24
+ <body>
25
+ <p>Example of a <a href="http://ogp.me/#type_book">book</a> object with an ISBN-13.</p>
26
+ </body>
27
+ </html>
@@ -0,0 +1,16 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head prefix="og: http://ogp.me/ns#">
4
+ <meta charset="utf-8">
5
+ <title>Canadian, eh?</title>
6
+ <meta property="og:type" content="website">
7
+ <meta property="og:locale" content="en_CA">
8
+ <meta property="og:title" content="Canadian, eh?">
9
+ <link rel="canonical" href="http://examples.opengraphprotocol.us/canadian.html">
10
+ <meta property="og:url" content="http://examples.opengraphprotocol.us/canadian.html">
11
+ <meta property="og:image" content="http://examples.opengraphprotocol.us/media/images/50.png">
12
+ </head>
13
+ <body>
14
+ <p>Some Canadians speak English. If I wanted to localize to Canadian English I might add a locale of en_CA.</p>
15
+ </body>
16
+ </html>
@@ -0,0 +1,17 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
6
+ <title>Not Found</title>
7
+ <meta name="description" content="Content does not exist.">
8
+ <meta name="robots" content="noindex,nofollow">
9
+ </head>
10
+ <body itemscope itemtype="http://schema.org/WebPage">
11
+ <header><h1 itemprop="name">Not Found</h1></header>
12
+ <div role="main">
13
+ <p itemprop="description">No content found for given URL.</p>
14
+ <p>Try navigating to content of interest from <a href="/">the home page</a>.</p>
15
+ </div>
16
+ </body>
17
+ </html>
@@ -0,0 +1,25 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head prefix="og: http://ogp.me/ns# article: http://ogp.me/ns/article#">
4
+ <meta charset="utf-8">
5
+ <title>5 Held in Plot to Bug Office</title>
6
+ <meta property="og:title" content="5 Held in Plot to Bug Office">
7
+ <meta property="og:site_name" content="Open Graph protocol examples">
8
+ <meta property="og:type" content="article">
9
+ <meta property="og:locale" content="en_US">
10
+ <link rel="canonical" href="http://examples.opengraphprotocol.us/errors/article-date.html">
11
+ <meta property="og:url" content="http://examples.opengraphprotocol.us/errors/article-date.html">
12
+ <meta property="og:image" content="http://examples.opengraphprotocol.us/media/images/50.png">
13
+ <meta property="og:image:secure_url" content="https://d72cgtgi6hvvl.cloudfront.net/media/images/50.png">
14
+ <meta property="og:image:width" content="50">
15
+ <meta property="og:image:height" content="50">
16
+ <meta property="og:image:type" content="image/png">
17
+ <meta property="article:published_time" content="June 18, 1972">
18
+ <meta property="article:author" content="http://examples.opengraphprotocol.us/profile.html">
19
+ <meta property="article:section" content="Front page">
20
+ <meta property="article:tag" content="Watergate">
21
+ </head>
22
+ <body>
23
+ <p>Example of an <a href="http://ogp.me/#type_article">article</a> object with a published_time value not formatted as an ISO 8601 date.</p>
24
+ </body>
25
+ </html>
@@ -0,0 +1,27 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head prefix="og: http://ogp.me/ns# book: http://ogp.me/ns/book#">
4
+ <meta charset="utf-8">
5
+ <title>Steve Jobs</title>
6
+ <meta property="og:title" content="Steve Jobs">
7
+ <meta property="og:site_name" content="Open Graph protocol examples">
8
+ <meta property="og:type" content="book">
9
+ <meta property="og:locale" content="en_US">
10
+ <link rel="canonical" href="http://examples.opengraphprotocol.us/errors/book-author.html">
11
+ <meta property="og:url" content="http://examples.opengraphprotocol.us/errors/book-author.html">
12
+ <meta property="og:image" content="http://examples.opengraphprotocol.us/media/images/50.png">
13
+ <meta property="og:image:secure_url" content="https://d72cgtgi6hvvl.cloudfront.net/media/images/50.png">
14
+ <meta property="og:image:width" content="50">
15
+ <meta property="og:image:height" content="50">
16
+ <meta property="og:image:type" content="image/png">
17
+ <meta property="book:author" content="Walter Isaacson">
18
+ <meta property="book:isbn" content="978-1451648539">
19
+ <meta property="book:release_date" content="2011-10-24">
20
+ <meta property="book:tag" content="Steve Jobs">
21
+ <meta property="book:tag" content="Apple">
22
+ <meta property="book:tag" content="Pixar">
23
+ </head>
24
+ <body>
25
+ <p>Example of a <a href="http://ogp.me/#type_book">book</a> object with an author's name provided in book:author instead of a URL.</p>
26
+ </body>
27
+ </html>