Bitly-0.0.5: A library and a command line tool to access bit.ly URL shortener.

Network.Bitly

Description

This package allows to use bit.ly and j.mp URL shortening service from Haskell programs. See also Network.TinyURL module.

Synopsis

Documentation

data Account Source

Service credentials.

Constructors

Account 

Fields

login :: String

bit.ly login name

apikey :: String

API key as found at http://bit.ly/account/

server :: String

Server to use, e.g. http://api.j.mp

Instances

bitlyAccount :: AccountSource

Account to use with bit.ly

jmpAccount :: AccountSource

Account to use with j.mp

shortenSource

Arguments

:: Account

Account to use

-> String

Long URL

-> IO Result

Either error or short bit.ly URL

Given a long URL, shorten encodes it as a shorter one.

expandSource

Arguments

:: Account

Account to use

-> String

Short bit.ly URL

-> IO Result

Either error or long source URL

Given a short bit.ly URL, expand decodes it back into a long source URL.

type Result = Either String StringSource

Either an error message or a modified URL