url-shortener

Small library that uses external URL shorteners transparently.

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      url-shortener:
        github: juanmougan/url-shortener
  2. Run shards install

Usage

require "url-shortener"

API

Without specifing a provider

The simplest use case is to only provide a URL, and rely on the default provider.

shortened = UrlShortener::Shortener
  .from_url("www.uca.edu.ar")
  .shorten

Specifing a provider

Alternatively, you can specify a provider to generate the URL.

shortened = UrlShortener::Shortener
  .from_url("www.uca.edu.ar")
  .with_provider(UrlShortener::TinyUrlProvider.new)
  .shorten

Development

TODO Write development instructions here

Contributing

  1. Fork it (https://github.com/juanmougan/url-shortener/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors