diff --git a/README.md b/README.md index b107628..0818775 100644 --- a/README.md +++ b/README.md @@ -62,9 +62,43 @@ GitHub is the best place to build software together. Over 4 million people use G https://github.global.ssl.fastly.net/images/modules/open_graph/github-octocat.png ``` +```php +$linkPreview = new LinkPreview('https://www.youtube.com/watch?v=8ZcmTl_1ER8'); +$parsed = $linkPreview->getParsed(); +foreach ($parsed as $parserName => $link) { + echo $parserName . PHP_EOL . PHP_EOL; + + echo $link->getUrl() . PHP_EOL; + echo $link->getRealUrl() . PHP_EOL; + echo $link->getTitle() . PHP_EOL; + echo $link->getDescription() . PHP_EOL; + echo $link->getImage() . PHP_EOL; + echo $link->getVideoId() . PHP_EOL; + echo $link->getEmbedCode() . PHP_EOL; +} +``` + + +**Output** + +``` +youtube + +https://www.youtube.com/watch?v=8ZcmTl_1ER8 +http://gdata.youtube.com/feeds/api/videos/8ZcmTl_1ER8?v=2&alt=jsonc +Epic sax guy 10 hours +I had to remove my original one so I reuploaded this with much better quality. +(If you want it sound like previous one, try setting quality to 240p) +Yeah, I know that video sucks compared to original but no can do :( +http://i1.ytimg.com/vi/8ZcmTl_1ER8/hqdefault.jpg +8ZcmTl_1ER8 +