2017 © Pedro Peláez
 

library url-finder

Composer package by Max Khartanovych

image

mxkh/url-finder

Composer package by Max Khartanovych

  • Wednesday, April 27, 2016
  • by maxHartanovich
  • Repository
  • 2 Watchers
  • 4 Stars
  • 447 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 10 Versions
  • 119 % Grown

The README.md

Description

This simple library will help you find URLs in the html page or in the text. Also there is support for popular video services such as Youtube, Rutube, Vimeo., (*1)

Installing

TODO, (*2)

How-to

Find first URL in the html page or in the text:, (*3)

$content = '<a href="https://www.youtube.com/watch?v=Fz4F2X1xSc8">Full Resort Segment from "Days of My Youth"</a>
            https://www.youtube.com/watch?v=EhhNOYsAcGQ
            <iframe src="https://player.vimeo.com/video/143534786" width="500" height="281" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
            <p><a href="https://vimeo.com/143534786">Filthy but Fine</a> from <a href="https://vimeo.com/arthurmetcalf">Arthur Metcalf</a> on <a href="https://vimeo.com">Vimeo</a>.</p>
            http://rutube.ru/video/6af96109ba23424897b961de023126c9/?ref=search';
$urlFinder = new UrlFinder();
$urls = $urlFinder->url->find($content)->one();

Find all URLs in the html page or in the text:, (*4)

$urlFinder = new UrlFinder();
$urls = $urlFinder->url->find($content)->all();

Find first Youtube video URL in the html page or in the text:, (*5)

$urlFinder = new UrlFinder();
$urls = $urlFinder->youtube->find($content)->one();

Find all Youtube video URLs in the html page or in the text:, (*6)

$urlFinder = new UrlFinder();
$urls = $urlFinder->youtube->find($content)->all();

Find Vimeo video URL in the html page or in the text:, (*7)

$urlFinder = new UrlFinder();
$urls = $urlFinder->vimeo->find($content)->one();

Find all Vimeo video URLs in the html page or in the text:, (*8)

$urlFinder = new UrlFinder();
$urls = $urlFinder->vimeo->find($content)->all();

Find RuTube video URL in the html page or in the text:, (*9)

$urlFinder = new UrlFinder();
$urls = $urlFinder->rutube->find($content)->one();

Find all RuTube video URLs in the html page or in the text:, (*10)

$urlFinder = new UrlFinder();
$urls = $urlFinder->rutube->find($content)->all();

Thanks to:

jmrware(https://github.com/jmrware) & wwdboer(https://gist.github.com/wwdboer) for writing the regexps for the Youtube & Vimeo, (*11)

The Versions

27/04 2016

dev-develop

dev-develop

Composer package by Max Khartanovych

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

27/04 2016

dev-master

9999999-dev

Composer package by Max Khartanovych

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

09/11 2015

0.1.8

0.1.8.0

Composer package by Max Khartanovych

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

09/11 2015

0.1.7

0.1.7.0

Composer package by Max Khartanovych

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

09/11 2015

0.1.6

0.1.6.0

Composer package by Max Khartanovych

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

02/11 2015

0.1.5

0.1.5.0

Composer package by Max Khartanovych

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

02/11 2015

0.1.4

0.1.4.0

Composer package by Max Khartanovych

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

02/11 2015

0.1.3

0.1.3.0

Composer package by Max Khartanovych

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

02/11 2015

0.1.2

0.1.2.0

Composer package by Max

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

02/11 2015

0.1.0

0.1.0.0

Composer package by Max

  Sources   Download

MIT

The Requires

  • php >=5.4.0