lcherpit / RRoEmbed

RRoEmbed is a PHP 5 library which provides an interface to consume oEmbed resources.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RRoEmbed

Description

RRoEmbed is a PHP 5 library which provides an interface to consume oEmbed resources.

oEmbed

oEmbed is a format for allowing an embedded representation of a URL on third party sites. The simple API allows a website to display embedded content (such as photos or videos) when a user posts a link to that resource, without having to parse the resource directly.

Read more: oEmbed website

Usage

<?php

// Include the autoloader.
require_once( dirname( __FILE__ ) . '/Classes/Autoloader.class.php' );

// Register the autoloader.
RRoEmbed_Autoloader::getInstance()->register();

// Create a new consumer.
$c = new RRoEmbed_Consumer();

// Call the "consume" method and supply it the URL of the resource you'd like
// to get the oEmbed representation of and the Provider instance.
$o = $c->consume(
    'http://www.flickr.com/photos/romac17/4101838222/',
    new RRoEmbed_Provider_Flickr()
);

// Notice you can also omit to specify the provider, if so the Consumer will try to
// automatically find a valid provider endpoint.
// $o = $c->consume( 'http://www.flickr.com/photos/romac17/4101838222/' );

print $o;

License

The code is licensed under the very liberal MIT license.

About

RRoEmbed is a PHP 5 library which provides an interface to consume oEmbed resources.

License:Other


Languages

Language:PHP 100.0%