PHPackages                             torann/embedder - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. torann/embedder

ActiveLibrary[Image &amp; Media](/categories/media)

torann/embedder
===============

Fetch embeddable links from text and fetch OpenGraph data.

0.0.4(8y ago)2465BSD 2-ClausePHPPHP &gt;=5.5.9

Since Mar 2Pushed 7y ago1 watchersCompare

[ Source](https://github.com/Torann/embedder)[ Packagist](https://packagist.org/packages/torann/embedder)[ RSS](/packages/torann-embedder/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

Link Embedder
=============

[](#link-embedder)

[![Build Status](https://camo.githubusercontent.com/e267ce2cbe5e47440c4d4dfaf7a277c8c46973e9a473bb95b3fe53bdb3a71ae4/68747470733a2f2f7472617669732d63692e6f72672f546f72616e6e2f656d6265646465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Torann/embedder)[![Latest Stable Version](https://camo.githubusercontent.com/df7e43e79ebe472b5e4a831742bc4f5d02b086815035d0039f46a45b2bcbb866/68747470733a2f2f706f7365722e707567782e6f72672f746f72616e6e2f656d6265646465722f762f737461626c652e706e67)](https://packagist.org/packages/torann/embedder)[![Total Downloads](https://camo.githubusercontent.com/dc3790ecbde01f6bfec9b57bd32eaef4e55b8e4d8b49d3eae84daf0bd0bbd9f8/68747470733a2f2f706f7365722e707567782e6f72672f746f72616e6e2f656d6265646465722f646f776e6c6f6164732e706e67)](https://packagist.org/packages/torann/embedder)[![Patreon donate button](https://camo.githubusercontent.com/f9e075baad95563481d35174d43ef50757281abb6bc795d0f473fad452afa030/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f70617472656f6e2d646f6e6174652d79656c6c6f772e737667)](https://www.patreon.com/torann)[![Donate weekly to this project using Gratipay](https://camo.githubusercontent.com/0eeae019980adaa1dc64842cfb01f3d738c688982ea4eb58094047011cb46704/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f67726174697061792d646f6e6174652d79656c6c6f772e737667)](https://gratipay.com/~torann)[![Donate to this project using Flattr](https://camo.githubusercontent.com/d79e412f78041f87e203449041ad81848a8405cf0f3c622c51e3bad0c2a4b599/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f666c617474722d646f6e6174652d79656c6c6f772e737667)](https://flattr.com/profile/torann)[![Donate to this project using Paypal](https://camo.githubusercontent.com/604e3db9c8751116b3f765aad0353ec7ded655bbe8aaacbc38d8c4a6b784b3ed/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f6e6174652d50617950616c2d677265656e2e737667)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4CJA2A97NPYVU)

Fetch embeddable links from text.

Installation
------------

[](#installation)

### Composer

[](#composer)

From the command line run:

```
$ composer require torann/embedder

```

Examples
--------

[](#examples)

### Extracting First Valid Video

[](#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 \Torann\Embedder\Embed();

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

Will output string:

```
//www.youtube.com/embed/W9cA9Z4bNzk

```

### Extracting All Videos

[](#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 \Torann\Embedder\Embed();

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

Will output array:

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

```

OpenGraph
---------

[](#opengraph)

Access OpenGraph meta data of a given URL.

```
$embedder = new \Torann\Embedder\Embed();

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

Will output array:

```
[
  "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"
    "height" => "1200"
  ],
  "url" => "http://www.rottentomatoes.com/m/771439257/"
]

```

Change Log
----------

[](#change-log)

**v0.0.3**

- Add simple OpenGraph support

**v0.0.2**

- Fix return type of single urls

**v0.0.1**

- First release

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~201 days

Total

2

Last Release

3160d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b740fab755b353680beb41191f3b6195d84d9811662960d07f2bf64fde2f7c64?d=identicon)[torann](/maintainers/torann)

---

Top Contributors

[![Torann](https://avatars.githubusercontent.com/u/1406755?v=4)](https://github.com/Torann "Torann (13 commits)")

---

Tags

embedderoembedopengraphaudioyoutubevimeoembedvideosdailymotionopengraphoembedvineembedder

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/torann-embedder/health.svg)

```
[![Health](https://phpackages.com/badges/torann-embedder/health.svg)](https://phpackages.com/packages/torann-embedder)
```

###  Alternatives

[mpratt/embera

Oembed consumer library. Converts urls into their html embed code. Supports 150+ sites, such as Youtube, Twitter, vimeo, Instagram etc.

3535.6M21](/packages/mpratt-embera)[essence/essence

Extracts information about medias on the web, like youtube videos, twitter statuses or blog articles.

770562.9k3](/packages/essence-essence)[cohensive/embed

Media Embed (for Laravel or as a standalone).

120370.4k](/packages/cohensive-embed)[cohensive/oembed

Media embed generation using OEmbed protocol.

3567.1k](/packages/cohensive-oembed)[dereuromark/media-embed

A PHP library to deal with all those media services around, parsing their URLs and embedding their audio/video content in websites.

182530.3k11](/packages/dereuromark-media-embed)[chojnicki/video-platforms-parser

Easy to use SDK with grabber for multiple platforms at once like YouTube, Dailymotion, Facebook and more.

22226.4k](/packages/chojnicki-video-platforms-parser)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
