2017 © Pedro Peláez
 

library embedly

Library for embed.ly APIs

image

emanueleminotto/embedly

Library for embed.ly APIs

  • Sunday, October 11, 2015
  • by EmanueleMinotto
  • Repository
  • 1 Watchers
  • 2 Stars
  • 1,413 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Embedly

Build Status SensioLabs Insight Coverage Status Scrutinizer Code Quality Total Downloads, (*1)

Library for embed.ly APIs based on Guzzle 5., (*2)

API: emanueleminotto.github.io/Embedly, (*3)

Install

Install the Embedly library adding emanueleminotto/embedly to your composer.json or from CLI:, (*4)

$ composer require emanueleminotto/embedly

Read more about the Composer installation here: getcomposer.org/doc/00-intro.md, (*5)

Usage

This library provides 3 API: embed.ly/docs/api., (*6)

Some APIs need an API key you can set in the constructor os using the setApiKey method. The second method of the constructor can be a Guzzle HTTP client to use as an alternative of the default one., (*7)

Embed

Options are available at http://embed.ly/docs/api/embed/arguments, (*8)

For this method the $api_key can be null., (*9)

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/'
    ]
]);

Extract

Options are available at http://embed.ly/docs/api/embed/arguments, (*10)

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/'
    ]
]);

Display

The first argument can be NULL, crop, resize or fill., (*11)

Options are available at, (*12)

  • http://embed.ly/docs/api/display/endpoints/1/display
  • http://embed.ly/docs/api/display/endpoints/1/display/crop
  • http://embed.ly/docs/api/display/endpoints/1/display/resize
  • http://embed.ly/docs/api/display/endpoints/1/display/fill

Currently the url attribute is required., (*13)

use EmanueleMinotto\Embedly\Client;

$client = new Client($api_key);

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

Twig Extension

In this library there's included a Twig extension to allow a simple integration with frameworks., (*14)

Functions prefix is: embedly_, arguments are the same of the methods above., (*15)

{{ embedly_oembed({url: 'http://www.example.com'}).title }} {# Example Domain #}

The Versions

11/10 2015

dev-master

9999999-dev

Library for embed.ly APIs

  Sources   Download

MIT

The Requires

 

The Development Requires

oembed embed embedly

04/02 2015

1.1.0

1.1.0.0

Library for embed.ly APIs

  Sources   Download

MIT

The Requires

 

The Development Requires

oembed embed embedly

29/01 2015

1.0.0

1.0.0.0

Library for embed.ly APIs

  Sources   Download

MIT

The Requires

 

The Development Requires

oembed embed embedly