An Elixir API for bitly.
Add bitly to your list of dependencies in mix.exs:
def deps do
[
{:bitly, "~> 0.1"}
]
endYou 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.
- 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)