PHP code example of emanueleminotto / embedly-service-provider

1. Go to this page and download the library: Download emanueleminotto/embedly-service-provider 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/ */

    

emanueleminotto / embedly-service-provider example snippets


use EmanueleMinotto\EmbedlyServiceProvider\EmbedlyServiceProvider;

$app->register(new EmbedlyServiceProvider(), array(
    'embedly.api_key' => 'xxx', // default null, optional
    'embedly.twig' => false, // default true, optional
));

use Silex\Application;

$app->get('/get', function (Application $app) {
    $url = $app['request']->get('url');

    $data = $app['embedly']->oembed([
        'url' => $url,
    ]);

    return $app->json($data);
});