2017 © Pedro Peláez
 

library embedly

A Laravel 5.* package for the Embedly api

image

badawy/embedly

A Laravel 5.* package for the Embedly api

  • Wednesday, June 7, 2017
  • by badawy
  • Repository
  • 2 Watchers
  • 9 Stars
  • 886 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

badawy/embedly

Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

Custom Embedly Package for the Laravel 5.*, (*2)

Installation

1) Pull this package in through Composer. (Laravel 5.4), (*3)


{ "require": { "badawy/embedly": "2.*" } }

if you are using Laravel 5.3 or earlier you should use v1.*


{ "require": { "badawy/embedly": "1.*" } }

2) Add the service provider to the providers array in your config/app.php file:, (*4)

        Badawy\Embedly\EmbedlyServiceProvider::class,

3) Add the facade to your config/app.php file:, (*5)

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

4) Copy the package config to your local config with the publish command:, (*6)

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

5) Add your api key in your .env file:, (*7)

        EMBEDLY_API_KEY=xxxxxxxxxxxxxxxxxx

Usage

You can extract or embed single URL or multiple URLs by pass them into an Array instead of String,, (*8)

You can also pass an Array of your query arguments as second argument in both Extract and Embed (see examples), (*9)

[See Embedly documentation for more information about results, errors and query arguments] (http://embed.ly/docs), (*10)

Examples

1) Embedly Extract, (*11)

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

2) Embedly Embed, (*12)

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

Then you can access results :, (*13)

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

ToDo

  • Add 'Display' APIs

License

This template is open-sourced software licensed under the MIT license, (*14)

Contact

Ahmad Elbadawy, (*15)

  • Email: ahmad.elbadawy@outlook.com

The Versions

07/06 2017

dev-master

9999999-dev

A Laravel 5.* package for the Embedly api

  Sources   Download

MIT

The Requires

 

by Ahmad Elbadawy

laravel api framework php class package embedly elbadawy badawy

07/06 2017

v2.0.0

2.0.0.0

A Laravel 5.* package for the Embedly api

  Sources   Download

MIT

The Requires

 

by Ahmad Elbadawy

laravel api framework php class package embedly elbadawy badawy

27/02 2017

v1.0.4

1.0.4.0

A Laravel 5.* package for the Embedly api

  Sources   Download

MIT

The Requires

 

by Ahmad Elbadawy

laravel api framework php class package embedly elbadawy badawy

17/09 2016

v1.0.3

1.0.3.0

A Laravel 5.* package for the Embedly api

  Sources   Download

MIT

The Requires

 

by Ahmad Elbadawy

laravel api framework php class package embedly elbadawy badawy

28/08 2016

v1.0.2

1.0.2.0

A Laravel 5.* package for the Embedly api

  Sources   Download

MIT

The Requires

 

by Ahmad Elbadawy

laravel api framework php class package embedly elbadawy badawy

07/08 2015

v1.0.1

1.0.1.0

A Laravel 5.* package for the Embedly api

  Sources   Download

MIT

The Requires

 

by Ahmad Elbadawy

laravel api framework php class package embedly elbadawy badawy

07/08 2015

dev-div

dev-div

A Laravel 5.* package for the Embedly api

  Sources   Download

MIT

The Requires

 

by Ahmad Elbadawy

laravel api framework php class package embedly elbadawy badawy

10/07 2015

1.0.0

1.0.0.0

A Laravel 5.* package for the Embedly api

  Sources   Download

MIT

The Requires

 

by Ahmad Elbadawy