An open API service indexing awesome lists of open source software.

https://github.com/arnaud-lb/alb-oembed

Simple PHP oEmbed consumer library with discovery support
https://github.com/arnaud-lb/alb-oembed

Last synced: about 2 months ago
JSON representation

Simple PHP oEmbed consumer library with discovery support

Awesome Lists containing this project

README

        

# PHP oEmbed consumer library

[![Build Status](https://secure.travis-ci.org/arnaud-lb/alb-oembed.png)](http://travis-ci.org/arnaud-lb/alb-oembed)

Simple consumer library for [oEmbed](http://oembed.com/) with discovery support.

## Usage

In this example the library automatically discovers the oEmbed enpoint for the `http://vimeo.com/31423544` resource, and asks for informations about the resource.

``` php
400,
'maxheight' => 300,
));

echo $response->getTitle();
echo $response->getHtml();
```

### Advanced usage:

``` php
request('http://vimeo.com/31423544');
```

The library is also capable of discovering the oEmbed enpoint from a resource URL (if the site supports it):

``` php
discover('http://vimeo.com/31423544');

// or, using OEmbed\Simple:

$provider = OEmbed\Simple::getProvider('http://vimeo.com/31423544');
```