PHP code example of badawy / embedly

1. Go to this page and download the library: Download badawy/embedly library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

badawy / embedly example snippets


        Badawy\Embedly\EmbedlyServiceProvider::class,

        'Embedly' => Badawy\Embedly\Facades\Embedly::class,

        php artisan vendor:publish --provider="Badawy\Embedly\EmbedlyServiceProvider"

     $q = Embedly::extract('http://techcrunch.com/2013/03/26/embedly-now-goes-beyond-embedding-with-new-products-extract-display-for-making-sense-of-links-resizing-images/', [
           'maxwidth' => '500'
       ]);

     $q = Embedly::extract([
            'http://techcrunch.com/2013/03/26/embedly-now-goes-beyond-embedding-with-new-products-extract-display-for-making-sense-of-links-resizing-images/',
            'http://deadspin.com/5690535/the-bottom-100-the-worst-players-in-nfl-history-part-1',
            'http://blog.embed.ly/31814817'],[
                'maxwidth' => '500'
       ]);

     $q = Embedly::oembed('http://vimeo.com/18150336',[
           'maxwidth' => '500'
       ]);

     $q = Embedly::oembed([
            'https://www.youtube.com/watch?v=jofNR_WkoCE',
            'http://soundcloud.com/whichlight/how-to-pronounce-my-name',
            'http://vimeo.com/18150336'],[
                'maxwidth' => '500'
       ]);

    if($q->error){
       echo $q->error_message; //Error
    } else {
       echo $q->title; //Get result
    }