You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A simple library to read Open Graph data from the web and generate HTML code to publish your own Open Graph objects. A fallback mode enables you to read data from websites that do not implement the Open Graph protocol.
8
+
A simple library to read Open Graph data from the web and generate HTML code to publish your own Open Graph objects. A
9
+
fallback mode enables you to read data from websites that do not implement the Open Graph protocol.
9
10
10
-
Using this library you can easily retrieve stuff like meta data, video information from YouTube or Vimeo or image information from Flickr without using site-specific APIs since they all implement the Open Graph protocol.
11
+
Using this library you can easily retrieve stuff like metadata, video information from YouTube or Vimeo or image
12
+
information from Flickr without using site-specific APIs since they all implement the Open Graph protocol.
11
13
12
-
See [ogp.me](http://ogp.me) for information on the Open Graph protocol.
14
+
See [ogp.me](https://ogp.me) for information on the Open Graph protocol.
*[psr/http-client](https://github.com/php-fig/http-client), [psr/http-factory](https://github.com/php-fig/http-factory) and compatible implementation such as [guzzle/guzzle](https://github.com/guzzle/guzzle)
$image = new Image("https://i1.ytimg.com/vi/P422jZg50X4/maxresdefault.jpg");
93
100
$object->images[] = $image;
94
101
95
102
// Videos
96
-
$video = new Video("http://www.youtube.com/v/P422jZg50X4?version=3&autohide=1");
103
+
$video = new Video("https://www.youtube.com/v/P422jZg50X4?version=3&autohide=1");
97
104
$video->height = 1080;
98
105
$video->width = 1920;
99
106
$video->type = "application/x-shockwave-flash";
@@ -125,18 +132,20 @@ _HTML code is formatted just for displaying purposes. You may choose between HTM
125
132
126
133
## Running tests
127
134
128
-
You can run the test suite by running `phpunit` from the command line.
135
+
You can run the test suite by running `composer test` from the command line.
129
136
130
137
## FAQ
131
138
132
139
**I don't get any information from a webpage, but Facebook shows information for the same URL. What do I do wrong?**
133
140
134
-
It seems that some pages (like Twitter) only publish OpenGraph information if Facebook's user agent string `facebookexternalhit/1.1` is used (see #28). So you should configure your PSR-18 client to use this user agent string:
141
+
It seems that some pages (like Twitter/X) only publish Open Graph information if Facebook's user agent string
142
+
`facebookexternalhit/1.1` is used (see [#28](https://github.com/fusonic/opengraph/issues/28)). So you should configure
0 commit comments