# Embera [![Total Downloads](https://img.shields.io/packagist/dt/mpratt/embera.svg)](https://packagist.org/packages/mpratt/embera) [![Support via PayPal](https://cdn.rawgit.com/twolfson/paypal-github-button/1.0.0/dist/button.svg)](https://paypal.me/mtpratt) **PLEASE UPDATE TO VERSION 2.0.0** **VERSION 1.9.X WILL RECEIVE SECURITY UPDATES / MINOR UPDATES BUT ITS NOT GOING TO SUPPORT NEW PROVIDERS.** Embera is a [Oembed](http://oembed.com/) consumer library written in PHP. Basically what it does is take urls from a text and queries the matching service for information about the media. If you are like me, in most cases all you want is to convert a simple Url to a valid html embed code. Now, the sweet thing about Embera, is that some providers allow you to skip the part about making the request to a Oembed Provider and still get a valid html embed code! Read the `Offline Support` section for more information. On the other hand, there are some oembed providers that dont return html embeddable code - Embera detects this and most of the time, it tries to generate a valid html code for you to use. Check out the `Basic Usage` instructions for more information. # Supported Sites Embera supports **60+** sites. Sites marked with an `*` allow offline html embedding - - [Youtube](http://www.youtube.com/) - - [Vimeo](http://vimeo.com/) - - [DailyMotion](http://www.dailymotion.com/) - [Instagram](http://instagram.com) - [SoundCloud](http://soundcloud.com) - [Twitter](https://twitter.com) - - [Ted](http://ted.com) - [Flickr](http://flickr.com) - [Revision3](http://revision3.com) - [Hulu](http://www.hulu.com) - - [Kickstarter](http://www.kickstarter.com) - [Deviantart](http://deviantart.com) - [Facebook](https://facebook.com) (Public Posts/Videos) - - [Scribd](http://www.scribd.com) **And many many more!** for the full list checkout the [PROVIDERS.md](https://github.com/mpratt/Embera/blob/master/PROVIDERS.md) file. # Requirements - PHP >= 5.6 (probably works on + 5.3) - Curl or `allow_url_fopen` must be enabled # Installation ### Install with Composer If you're using [Composer](https://github.com/composer/composer) to manage dependencies, you can use this library by creating a composer.json and adding this: { "require": { "mpratt/embera": "~1.0" } } Save it and run `composer.phar install` ### Standalone Installation (without Composer) Download the latest release or clone this repository, place the `Lib/Embera` directory on your project. Afterwards, you only need to include the Autoload.php file. ```php require '/path/to/Embera/Autoload.php'; $embera = new \Embera\Embera(); ``` Or if you already have PSR-0 complaint autoloader, you just need to register Embera ```php $loader->registerNamespace('Embera', 'path/to/Embera'); ``` # Basic Usage For autoconverting urls into html embeddable code, use the `autoEmbed()` method: ```php $text = 'Hi, I just saw this video http://www.dailymotion.com/video/xxwxe1_harlem-shake-de-los-simpsons_fun'; $embera = new \Embera\Embera(); echo $embera->autoEmbed($text); /* Hi, I just saw this video