<commit_before>URL shortener library
=====================

This library allows you to shorten a URL, reverse is also possible.

**Basic Docs**

* [Installation](#installation)
* [Bit.ly API](#bitly-api)

<a name="installation"></a>

## Installation

Only 1 step:

### Download UrlShortener using composer

Add UrlShortener in your composer.json:

```js
{
    "require": {
        "mremi/url-shortener": "dev-master"
    }
}
```

Now tell composer to download the library by running the command:

``` bash
$ php composer.phar update mremi/url-shortener
```

Composer will install the library to your project's `vendor/mremi` directory.

<a name="bitly-api"></a>

## Bit.ly API

```php
<?php

use Mremi\UrlShortener\Bitly\BitlyShortener;
use Mremi\UrlShortener\Bitly\OAuthClient;
use Mremi\UrlShortener\Http\ClientFactory;

$clientFactory = new ClientFactory;

$shortener = new BitlyShortener($clientFactory, new OAuthClient($clientFactory, 'username', 'password'));

$shortened = $shortener->shorten('http://www.google.com');

$expanded = $shortener->expand('http://bit.ly/13TE0qU');
```
<commit_msg>Added badges in README.md<commit_after>URL shortener library
=====================

This library allows you to shorten a URL, reverse is also possible.

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

**Basic Docs**

* [Installation](#installation)
* [Bit.ly API](#bitly-api)

<a name="installation"></a>

## Installation

Only 1 step:

### Download UrlShortener using composer

Add UrlShortener in your composer.json:

```js
{
    "require": {
        "mremi/url-shortener": "dev-master"
    }
}
```

Now tell composer to download the library by running the command:

``` bash
$ php composer.phar update mremi/url-shortener
```

Composer will install the library to your project's `vendor/mremi` directory.

<a name="bitly-api"></a>

## Bit.ly API

```php
<?php

use Mremi\UrlShortener\Bitly\BitlyShortener;
use Mremi\UrlShortener\Bitly\OAuthClient;
use Mremi\UrlShortener\Http\ClientFactory;

$clientFactory = new ClientFactory;

$shortener = new BitlyShortener($clientFactory, new OAuthClient($clientFactory, 'username', 'password'));

$shortened = $shortener->shorten('http://www.google.com');

$expanded = $shortener->expand('http://bit.ly/13TE0qU');
```

{'fraction_non_alphanumeric': 0.1685867895545315, 'fraction_numerical': 0.0030721966205837174, 'mean_word_length': 5.172985781990521, 'pattern_counts': {'":': 4, '<': 13, '<?xml version=': 0, '>': 15, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1282281', 'n_tokens_mistral': 921, 'n_tokens_neox': 887, 'n_words': 192}