/bitly-elixir

An Elixir API for bitly

Primary LanguageElixirMIT LicenseMIT

Bitly

CI Hex.pm Coverage Status

An Elixir API for bitly.

Installation

Add bitly to your list of dependencies in mix.exs:

def deps do
  [
    {:bitly, "~> 0.1"}
  ]
end

Configuration

You can optionally set access_token value in your config/config.exs file:

config :bitly, access_token: "ACCESS_TOKEN"

This will be used as a default access_token when making an API call to bitly.

Examples

  • Getting info with default client:
iex(1)> Bitly.Link.shorten("http://google.com/")
  • Getting info with defined client:
iex(1)> client = Bitly.Client.new(access_token: "ACCESS_TOKEN")
iex(2)> Bitly.Link.shorten("http://google.com/", [], client)