URL Shortener

URL Shortener provides a developer API for creating short versions of longer SilverStripe? URLs.

Requirements

  • SilverStripe 2.4

Installation

  • Extract to a folder in your SilverStripe installation directory.
  • Run /dev/build?flush=1

Usage Overview

Shorten URLs with:

$shortURL = URLShortener::shorten($longURL);

Expand URLs with:

$longURL = URLShortener::expand($shortURL);

Create new services by implementing URLShortenerService

Set alternative URL Shorteners in your _config.php with

URLShortener::set_url_shortener('BitlyURLShortener');

A bit.ly URL shortener service is provided. Apply for an API key at  http://bit.ly and add the following to your _config.php:

BitlyURLShortener::set_username_and_key('username', 'apikey') URLShortener::set_url_shortener('BitlyURLShortener');

Create a ticket