2017 © Pedro Peláez
 

library embedder

Fetch embeddable links from text.

image

octoflare/embedder

Fetch embeddable links from text.

  • Tuesday, May 17, 2016
  • by octoflare
  • Repository
  • 1 Watchers
  • 2 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Super Simple Link Embedder

Latest Stable Version Total Downloads Build Status, (*1)

Fetch embeddable links from text., (*2)

Installation

Composer

From the command line run:, (*3)

$ composer require octoflare/embedder

Examples

Extracting First Valid Video

$text = 'Hi, I just saw this video https://www.youtube.com/watch?v=W9cA9Z4bNzk and the http://youtu.be/dMH0bHeiddddd';
$embedder = new \OctoFlare\Embedder\Embed();

$output = $embedder->getUrl($text);

Will output string:, (*4)

//www.youtube.com/embed/W9cA9Z4bNzk

Extracting All Videos

$text = 'Hi, I just saw this video https://www.youtube.com/watch?v=W9cA9Z4bNzk and the http://youtu.be/dMH0bHeiddddd';
$embedder = new \OctoFlare\Embedder\Embed();

$output = $embedder->getUrls($text);

Will output array:, (*5)

[
    'https://www.youtube.com/watch?v=W9cA9Z4bNzk' => '//www.youtube.com/embed/W9cA9Z4bNzk',
    'http://youtu.be/dMH0bHeiddddd' => '//www.youtube.com/embed/dMH0bHeiddddd'
]

OpenGraph

Access OpenGraph meta data of a given URL., (*6)

$embedder = new \OctoFlare\Embedder\Embed();

$output = $embedder->getMeta('http://www.rottentomatoes.com/m/771439257');

Will output array:, (*7)

[
  "description" => "In this heart-pounding thriller from acclaimed writer and director Mike Flanagan (Oculus, Before I Wake), silence takes on a terrifying new dimension for a..."
  "title" => "Hush"
  "type" => "video.movie"
  "image" => "https://resizing.flixster.com/R6FvucOnw5bYh_sffSMbvFSXX2w=/220x326/v1.bTsxMTcwNDk2MDtqOzE2OTc1OzIwNDg7MjIwOzMyNg"
  "image:width" => "800"
  "image:height" => "1200"
  "url" => "http://www.rottentomatoes.com/m/771439257/"
]

Change Log

0.0.3, (*8)

  • Add simple OpenGraph support

0.0.2, (*9)

  • Fix return type of single urls

0.0.1, (*10)

  • First release

The Versions

17/05 2016

dev-master

9999999-dev

Fetch embeddable links from text.

  Sources   Download

BSD 2-Clause

The Requires

  • php >=5.5.9

 

The Development Requires

audio youtube oembed dailymotion vimeo videos embed vine embedder

17/05 2016

0.0.3

0.0.3.0

Fetch embeddable links from text.

  Sources   Download

BSD 2-Clause

The Requires

  • php >=5.5.9

 

The Development Requires

audio youtube oembed dailymotion vimeo videos embed vine embedder

19/12 2015

0.0.2

0.0.2.0

Fetch embeddable links from text.

  Sources   Download

BSD 2-Clause

The Requires

  • php >=5.5.9

 

The Development Requires

audio youtube oembed dailymotion vimeo videos embed vine embedder

19/12 2015

0.0.1

0.0.1.0

Fetch embeddable links from text.

  Sources   Download

BSD 2-Clause

The Requires

  • php >=5.5.9

 

The Development Requires

audio youtube oembed dailymotion vimeo videos embed vine embedder