UrlUnroller v0.0.3 UrlUnroller

Summary

Functions

Returns a long url for a given short url. Also returns the last HTTPoison status and response struct

Functions

unroll(url)

Returns a long url for a given short url. Also returns the last HTTPoison status and response struct.

Passing a long url is generally a noop (unless the url is a redirect).

Examples

iex> {status, url, _response_info} = UrlUnroller.unroll("http://bit.ly/1Bx0zo8")
iex> {status, url}
{:ok, "http://blog.semanticart.com/"}

iex> {status, url, {response_status, response}} = UrlUnroller.unroll("http://semanticart.com/something-that-does-not-exist")
iex> {status, url, response_status, response.status_code}
{:error, "http://semanticart.com/something-that-does-not-exist", :ok, 404}