PHP code example of emanueleminotto / embedly

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

    

emanueleminotto / embedly example snippets


use EmanueleMinotto\Embedly\Client;

$client = new Client($api_key);

$embed = $client->oembed([
    'url' => 'http://www.example.com/',
]);

// enumerated array containing
// arrays like $embed
$embeds = $client->oembed([
    'urls' => [
        'http://www.example.com/',
        'http://www.google.com/'
    ]
]);

use EmanueleMinotto\Embedly\Client;

$client = new Client($api_key);

$extracted = $client->extract([
    'url' => 'http://www.example.com/',
]);

// enumerated array containing
// arrays like $extracted
$extracteds = $client->oembed([
    'urls' => [
        'http://www.example.com/',
        'http://www.google.com/'
    ]
]);

use EmanueleMinotto\Embedly\Client;

$client = new Client($api_key);

$content = $client->display('resize', [
    'url' => 'http://placehold.it/250x100',
    'color' => '000',
    'height' => 150,
    'width' => 150,
]);