Skip to content

elifoster/isgd-rb

Repository files navigation

isgd-rb

Build Status Gem Version

A Ruby wrapper for the isgd API utilizing HTTPClient

Installation

Ruby Gems

$ gem install isgd

Bundler

Add this line to your Gemfile:

gem('isgd')

And then execute:

$ bundle install

Standard usage

require 'isgd'

# Standard URL shortening
ISGD.shorten('http://google.com')
# => "http://is.gd/OwycZW"

# Standard URL lookups
ISGD.lookup('http://is.gd/OwycZW')
# => "http://google.com"

# Error messages too!
ISGD.shorten('http://google')
# => "Please enter a valid URL to shorten"
ISGD.lookup('http://')
# => "Sorry, we couldn't find the shortened URL you requested. The link you followed may be invalid, or an evil wizard may have cast a spell on our servers."

Documentation

RubyDoc or the in-code documentation.