Bitly-0.0.3: A library and a command line tool to access bit.ly URL shortener.Source codeContentsIndex
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
data Account = Account {
login :: String
apikey :: String
server :: String
}
bitlyAccount :: Account
jmpAccount :: Account
shorten :: Account -> String -> IO Result
expand :: Account -> String -> IO Result
type Result = Either String String
Documentation
data Account Source
Service credentials.
Constructors
Account
login :: Stringbit.ly login name
apikey :: StringAPI key as found at http://bit.ly/account/
server :: StringServer to use, e.g. http://api.j.mp
show/hide Instances
bitlyAccount :: AccountSource
Account to use with bit.ly
jmpAccount :: AccountSource
Account to use with j.mp
shortenSource
:: AccountAccount to use
-> StringLong URL
-> IO ResultEither error or short bit.ly URL
Given a long URL, shorten encodes it as a shorter one.
expandSource
:: AccountAccount to use
-> StringShort bit.ly URL
-> IO ResultEither 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
Produced by Haddock version 2.4.2