<commit_before># Super Simple Video Embedder

[![Latest Stable Version](https://poser.pugx.org/octoflare/embedder/v/stable.png)](https://packagist.org/packages/octoflare/embedder) [![Total Downloads](https://poser.pugx.org/octoflare/embedder/downloads.png)](https://packagist.org/packages/octoflare/embedder) [![Build Status](https://travis-ci.org/octoflare/embedder.svg?branch=master)](https://travis-ci.org/octoflare/embedder)

Fetch embeddable links from text.

## Installation

### Composer

From the command line run:

```
$ composer require octoflare/embedder
```

## Examples

### Extracting First Valid Video

```php
$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:

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

### Extracting All Videos

```php
$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:

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

## Change Log

**12/19/2015**

 - First release<commit_msg>Add build badge<commit_after># Super Simple Video Embedder

[![Latest Stable Version](https://poser.pugx.org/octoflare/embedder/v/stable.png)](https://packagist.org/packages/octoflare/embedder) [![Total Downloads](https://poser.pugx.org/octoflare/embedder/downloads.png)](https://packagist.org/packages/octoflare/embedder) [![Build Status](https://travis-ci.org/OctoFlare/embedder.svg)](https://travis-ci.org/OctoFlare/embedder)

Fetch embeddable links from text.

## Installation

### Composer

From the command line run:

```
$ composer require octoflare/embedder
```

## Examples

### Extracting First Valid Video

```php
$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:

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

### Extracting All Videos

```php
$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:

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

## Change Log

**12/19/2015**

 - First release
{'fraction_non_alphanumeric': 0.18351254480286738, 'fraction_numerical': 0.01935483870967742, 'mean_word_length': 4.802494802494802, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 18, 'lorem ipsum': 0, 'www.': 12, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2665599', 'n_tokens_mistral': 1166, 'n_tokens_neox': 1090, 'n_words': 171}