2017 © Pedro Peláez
 

library longurl

This library extends short URLs to longURLs

image

tzfrs/longurl

This library extends short URLs to longURLs

  • Wednesday, September 9, 2015
  • by tzfrs
  • Repository
  • 1 Watchers
  • 4 Stars
  • 20 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

longurl

This library can be used to expand short URLs such as https://t.co/XdXRudPXH5 and get the URL that is behind the short URL, (*1)

Install

Install via composer:, (*2)

{
    "require": {
        "tzfrs/longurl": "0.0.4"
    }
}

Run composer install or composer update., (*3)

Attention

This library currently only supports methods for getting services, checking if an URL is a short URL and expanding URLs, because I'm just using it for a project that only needs these features. If you want extra features then just open an issue., (*4)

For caching, by default this library uses the /tmp/ directory. If you want to change it, just use the 2nd parameter of the constructor to define the cache path, (*5)

Getting Started

Note: You can also see the examples.php for more examples., (*6)

Basic parsing

<?php
require __DIR__ . '/vendor/autoload.php';

$expand = new \tzfrs\LongURL\Endpoints\Expand();
try {
    print $expand->expandURL('https://t.co/XdXRudPXH5'); //https://blog.twitter.com/2013/rich-photo-experience-now-in-embedded-tweets-3
    print $expand->expandURL('https://blog.twitter.com/2013/rich-photo-experience-now-in-embedded-tweets-3'); //https://blog.twitter.com/2013/rich-photo-experience-now-in-embedded-tweets-3
} catch (\tzfrs\LongURL\Exceptions\ExpandException $e) {
    print $e->getMessage();
}

List all services

<?php
require __DIR__ . '/vendor/autoload.php';

$services = new \tzfrs\LongURL\Endpoints\Services();
try {
    $services = $services->getServices(); // Object array with all services
} catch (\tzfrs\LongURL\Exceptions\ServicesException $e) {
    print $e->getMessage();
}

Check if is a short URL

<?php
require __DIR__ . '/vendor/autoload.php';

$services = new \tzfrs\LongURL\Endpoints\Services();
try {
    $services->isShortURL('https://t.co/XdXRudPXH5'); // True
    $services->isShortURL('https://blog.twitter.com/2013/rich-photo-experience-now-in-embedded-tweets-3'); // False
} catch (\tzfrs\LongURL\Exceptions\ServicesException $e) {
    print $e->getMessage();
}

The Versions

09/09 2015

dev-master

9999999-dev

This library extends short URLs to longURLs

  Sources   Download

proprietary

The Requires

 

The Development Requires

09/09 2015

dev-develop

dev-develop

This library extends short URLs to longURLs

  Sources   Download

proprietary

The Requires

 

The Development Requires

09/09 2015

0.0.5

0.0.5.0

This library extends short URLs to longURLs

  Sources   Download

proprietary

The Requires

 

The Development Requires

09/09 2015

dev-release/0.0.5

dev-release/0.0.5

This library extends short URLs to longURLs

  Sources   Download

proprietary

The Requires

 

The Development Requires

09/09 2015

dev-hotfix/Fix_error_stuff

dev-hotfix/Fix_error_stuff

This library extends short URLs to longURLs

  Sources   Download

proprietary

The Requires

 

The Development Requires

09/09 2015

0.0.4

0.0.4.0

This library extends short URLs to longURLs

  Sources   Download

proprietary

The Requires

 

The Development Requires

03/09 2015

0.0.3

0.0.3.0

This library extends short URLs to longURLs

  Sources   Download

proprietary

The Requires

 

The Development Requires

03/09 2015

0.0.2

0.0.2.0

This library extends short URLs to longURLs

  Sources   Download

proprietary

The Requires

 

The Development Requires

28/08 2015

0.0.1

0.0.1.0

This library extends short URLs to longURLs

  Sources   Download

proprietary

The Requires