2017 © Pedro Peláez
 

library embed-parser

Simple utility to parse URLs in HTML or text content which are placed on its own line to turn them into embeds.

image

dotsunited/embed-parser

Simple utility to parse URLs in HTML or text content which are placed on its own line to turn them into embeds.

  • Monday, July 17, 2017
  • by jsor
  • Repository
  • 6 Watchers
  • 0 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Embed Parser

Simple utility to parse URLs in HTML or text content which are placed on its own line to turn them into embeds., (*1)

Installation

Install the latest version with Composer., (*2)

composer require dotsunited/embed-parser

Check the Packagist page for all available versions., (*3)

Usage

There is single parse function provided which parses the given content and invokes a handler callback for each URL found., (*4)

$transformedContent = DotsUnited\EmbedParser\parse($content, function ($url) {
    $embedHtml = tranformUrlToEmbedHtml($url);

    return $embedHtml;
});

The URL must be on its own line or surrounded only by <p> tags with no other text content to be parsed., (*5)

Text

Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
sed diam nonumy eirmod tempor invidunt ut labore et dolore
magna aliquyam erat, sed diam voluptua.

https://youtube.com/watch?v=QcIy9NiNbmo

At vero eos et accusam et justo duo dolores et ea rebum.

HTML



Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. , (*6)

https://youtube.com/watch?v=QcIy9NiNbmo , (*7)

At vero eos et accusam et justo duo dolores et ea rebum. , (*8)

License

Copyright (c) 2017 Dots United GmbH. Released under the MIT license., (*9)

The Versions

17/07 2017

dev-master

9999999-dev https://github.com/dotsunited/embed-parser

Simple utility to parse URLs in HTML or text content which are placed on its own line to turn them into embeds.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

parser html oembed embed

16/05 2017

v0.4.0

0.4.0.0 https://github.com/dotsunited/embed-parser

Simple utility to parse URLs in HTML or text content which are placed on its own line to turn them into embeds.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

parser html oembed embed

16/05 2017

v0.3.0

0.3.0.0 https://github.com/dotsunited/embed-parser

Simple utility to parse URLs in HTML or text content which are placed on its own line to turn them into embeds.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

parser html oembed embed

16/05 2017

v0.2.0

0.2.0.0 https://github.com/dotsunited/embed-parser

Simple utility to parse URLs in HTML or text content which are placed on its own line to turn them into embeds.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

parser html oembed embed

16/05 2017

v0.1.0

0.1.0.0 https://github.com/dotsunited/embed-parser

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

parser html oembed embed