pingpong / oembed
Laravel 4 - Retrieve page info using oembed, opengraph, etc.
Installs: 2 089
Dependents: 1
Suggesters: 0
Security: 0
Stars: 13
Watchers: 3
Forks: 3
Open Issues: 2
Requires
- php: >=5.4.0
- embed/embed: 1.7.0
- illuminate/cache: 4.2.*
- illuminate/support: 4.2.*
Requires (Dev)
- mockery/mockery: 0.9.*
- phpunit/phpunit: 4.1.*
This package is not auto-updated.
Last update: 2024-11-05 03:22:48 UTC
README
Laravel 4 - Retrieve page info using oembed, opengraph, etc.
Server Requirements
Require PHP 5.4+ or higher.
Installation
Open your composer.json file, and add the new required package.
"pingpong/oembed": "1.0.*"
Next, open a terminal and run.
composer update
After the composer updated. Add new service provider in app/config/app.php.
'Pingpong\Oembed\OembedServiceProvider'
Next, Add new alias.
'Oembed' => 'Pingpong\Oembed\Facades\Oembed',
Done.
Usage
Basic Usage
$info = Oembed::get('https://www.youtube.com/watch?v=PP1xn5wHtxE'); //Get content info $info->title; //The page title $info->description; //The page description $info->url; //The canonical url $info->type; //The page type (link, video, image, rich) $info->images; //List of all images found in the page $info->image; //The image choosen as main image $info->imageWidth; //The with of the main image $info->imageHeight; //The height of the main image $info->code; //The code to embed the image, video, etc $info->width; //The with of the embed code $info->height; //The height of the embed code $info->aspectRatio; //The aspect ratio (width/height) $info->authorName; //The (video/article/image/whatever) author $info->authorUrl; //The author url $info->providerName; //The provider name of the page (youtube, twitter, instagram, etc) $info->providerUrl; //The provider url $info->providerIcons; //All provider icons found in the page $info->providerIcon; //The icon choosen as main icon
Caching the results.
$info = Oembed::cache($url, $options);
Documentation
Because this package using the library oscarotero/Embed, please refer to its documentation for more info.
License
This package is open-sourced software licensed under The BSD 3-Clause License