Web::oEmbed::Common - Define several well-known oEmbed providers.
my $consumer = Web::oEmbed::Common->new(); $consumer->set_embedly_api_key( '0123ABCD0123ABCD0123ABCD' ); my $response = $consumer->embed( $link_url ); if ( $response ) { print $response->title; print $response->render; }
Web::oEmbed::Common provides a subclass of Web::oEmbed that is pre-configured with the oEmbed API endpoints for dozens of popular web sites.
The interface mirrors that of Web::oEmbed: create an oEmbed client object and call its embed method for each URL you'd like more information about, then extract the response information using the methods defined by Web::oEmbed::Response.
embed
When you create a new instance of Web::oEmbed::Common, it is initialized with a default set of well-known providers.
Endpoints are currently defined for the following content sites: Blip.tv, DailyMotion, 5min, Flickr, FunnyOrDie.com, Hulu, PhotoBucket, PollDaddy.com, Qik, Revision3, Scribd, SmugMug, Viddler, Vimeo, WordPress.tv, YouTube.
Endpoints are also defined for the oEmbed proxy / adaptor services from Embed.ly and oohEmbed.com, each of which supports over a dozen content sites. Use of the Embed.ly service is subject to a daily rate limit, so you should consider obtaining your own API key by registering on their site.
You can add your own definitions using the register_provider method.
register_provider
As with Web::oEmbed, each provider definition should include a api parameter with the oEmbed endpoint URL, but there are minor differences in how you specify the target URLs which that service can handle.
api
The provider definition's url option can contain a whitespace-separated list of multiple URL patterns to match against. These URLs can contain optional portions or alternatives in parentheses.
url
http://www.oembed.com/, Web::oEmbed
Developed by Matthew Simon Cavalletto. You may contact the author directly at evo@cpan.org or simonm@cavalletto.org.
evo@cpan.org
simonm@cavalletto.org
I found some of these oEmbed endpoint URLs defined in similar libraries in other languages, including wp-includes/class-oembed, django-oembed, and ruby-oembed.
Copyright 2010, 2011 Matthew Simon Cavalletto.
You may use, modify, and distribute this software under the same terms as Perl.
See http://dev.perl.org/licenses/ for more information.
To install Web::oEmbed::Common, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Web::oEmbed::Common
CPAN shell
perl -MCPAN -e shell install Web::oEmbed::Common
For more information on module installation, please visit the detailed CPAN module installation guide.