NAME
    Mojolicious::Plugin::LinkEmbedder - Convert a URL to embedded content

VERSION
    0.05

DESCRIPTION
    This module can transform a URL to an iframe, image or other embeddable
    content.

SYNOPSIS
      use Mojolicious::Lite;
      plugin LinkEmbedder => { route => '/embed' };

    Or if you want full control:

      plugin 'LinkEmbedder';
      get '/embed' => sub {
        my $self = shift->render_later;

        $self->embed_link($self->param('url'), sub {
          my($self, $link) = @_;

          $self->respond_to(
            json => {
              json => {
                media_id => $link->media_id,
                url => $link->url->to_string,
              },
            },
            any => { text => "$link" },
          );
        });
      };

      app->start;

SUPPORTED LINKS
    *   Mojolicious::Plugin::LinkEmbedder::Link

    *   Mojolicious::Plugin::LinkEmbedder::Link::Game::_2play

    *   Mojolicious::Plugin::LinkEmbedder::Link::Image

    *   Mojolicious::Plugin::LinkEmbedder::Link::Video

    *   Mojolicious::Plugin::LinkEmbedder::Link::Video::Blip

    *   Mojolicious::Plugin::LinkEmbedder::Link::Video::Collegehumor

    *   Mojolicious::Plugin::LinkEmbedder::Link::Video::Dagbladet

    *   Mojolicious::Plugin::LinkEmbedder::Link::Video::Ted

    *   Mojolicious::Plugin::LinkEmbedder::Link::Video::Vimeo

    *   Mojolicious::Plugin::LinkEmbedder::Link::Video::Youtube

    *   Mojolicious::Plugin::LinkEmbedder::Link::Text

    *   Mojolicious::Plugin::LinkEmbedder::Link::Text::GistGithub

    *   Mojolicious::Plugin::LinkEmbedder::Link::Text::Twitter

METHODS
  embed_link
    See "SYNOPSIS".

  register
      $app->plugin('LinkEmbedder' => \%config);

    Will register the "embed_link" helper which creates new objects from
    Mojolicious::Plugin::LinkEmbedder::Default. %config is optional but can
    contain:

    *   route => $str|$obj

        Use this if you want to have the default handler to do link
        embedding. The default handler is shown in "SYNOPSIS". $str is just
        a path, while $obj is a Mojolicious::Routes::Route object.

AUTHOR
    Jan Henning Thorsen - "jhthorsen@cpan.org"

    Marcus Ramberg - "mramberg@cpan.org"

