PHPackages                             fideloper/porter - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. fideloper/porter

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

fideloper/porter
================

Extendable link-parser and meta-data obtainer for various services such as Vimeo and Youtube

51.7k2PHP

Since Jul 4Pushed 12y ago1 watchersCompare

[ Source](https://github.com/fideloper/Porter)[ Packagist](https://packagist.org/packages/fideloper/porter)[ RSS](/packages/fideloper-porter/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

\#Porter [![Total Downloads](https://camo.githubusercontent.com/f057ac4f2a4dad23098aed831907805c06866522fec1fa279b48cfa483440cb5/68747470733a2f2f706f7365722e707567782e6f72672f666964656c6f7065722f706f727465722f646f776e6c6f6164732e706e67)](https://packagist.org/packages/fideloper/porter)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[](#porter)

**Extendable url-parser thingy and meta-data obtainer for various services such as Youtube and Vimeo**

[![Sriracha!!!](https://camo.githubusercontent.com/a20d4141fec30281ce47d942eabda8919e9a12ad8f44a1a574e1ea30a54a6660/687474703a2f2f7374617469632d6c332e626c6f67637269746963732e6f72672f30392f31302f30392f3131353834392f30393130303673726972616368612e6a7067)](https://camo.githubusercontent.com/a20d4141fec30281ce47d942eabda8919e9a12ad8f44a1a574e1ea30a54a6660/687474703a2f2f7374617469632d6c332e626c6f67637269746963732e6f72672f30392f31302f30392f3131353834392f30393130303673726972616368612e6a7067)

What does it do?
----------------

[](#what-does-it-do)

Say you have a piece of content, maybe from a user on your site.

```
I love Sriracha sauce!!! I even put it on my Cinnamon Toast Struddle Crunch Tiger Blood Leprechaun cereal!
Here's a video review of it http://www.youtube.com/watch?v=GYamE6G1EZo,
and a spiffy ad for Sriracha Sauce!!! http://vimeo.com/41852814

```

You like how Twitter shows an embed and information about linked Youtube videos, so you figure

> Hey, Twitter is cool! I'm gonna do exactly what Twitter does so I'm cool too!

Well you're in luck! Using this spicy library, you can grab the URLs from content and get meta information about them.

How do I use it?
----------------

[](#how-do-i-use-it)

```
$some_weirdos_comment = "I love Sriracha sauce!!! I even put it on my Cinnamon Toast Struddle Crunch Tiger Blood Leprechaun cereal! Here's a video review of it http://www.youtube.com/watch?v=GYamE6G1EZo, and a spiffy ad for Sriracha Sauce!!! http://vimeo.com/41852814";

$parser = new \Porter\Parser();

// I want YouTooooooob!
$parser->addService( new \Porter\Service\Youtube() );

// I want Vimeooooooooo!
$parser->addService( new \Porter\Service\Vimeo() );

$parsed_urls = $parser->parse( $parser->matchUrls($some_weirdos_comment) );

// ID's Parsed from URLs directly
foreach ( $parsed_urls as $parsed )
{
    $item_id = $parsed->getId(); //Youtube: GYamE6G1EZo, Vimeo: 41852814
}

// Now, let's get fancy with some API requests
foreach ( $parsed_urls as $parsed )
{
    $meta = $parsed->getMetadata( new \Porter\Request\Curl() ); // stdClass of data
}
```

Foreach service (Currently Youtube, Vimeo), you can get:

1. Video ID
2. Meta Data Available via public api
    - ID
    - Image
    - Play Time
    - Title
    - etc

Contribute!
-----------

[](#contribute)

There's room for improvement. For instance:

1. I've abstracted out a Request implementation, when the code using it pretty clearly expects a cURL request to happen (Gives it a URL to grab data from)
2. Only supports Youtube/Vimeo at the moment (Flickr? Twitpic? etc etc)
3. The Parser class loops through each service, and creates a new instance of each service on each iteration. Needed for multiple URLs, but I dislike the implementation.

Licence
-------

[](#licence)

```
MIT

```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity43

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/5ffe7f19bdf080aaa14107239624d682f2e1b139b9459e93b56966649a4d7873?d=identicon)[fideloper](/maintainers/fideloper)

---

Top Contributors

[![fideloper](https://avatars.githubusercontent.com/u/467411?v=4)](https://github.com/fideloper "fideloper (2 commits)")

### Embed Badge

![Health badge](/badges/fideloper-porter/health.svg)

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

###  Alternatives

[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M65](/packages/sabberworm-php-css-parser)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)[jms/serializer-bundle

Allows you to easily serialize, and deserialize data of any complexity

1.8k89.3M627](/packages/jms-serializer-bundle)[hassankhan/config

Lightweight configuration file loader that supports PHP, INI, XML, JSON, and YAML files

97513.5M170](/packages/hassankhan-config)[meyfa/php-svg

Read, edit, write, and render SVG files with PHP

54613.9M42](/packages/meyfa-php-svg)

PHPackages © 2026

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