Packages

A wrapper for the Tibia Data API.

Current section

Files

Jump to
tibia_data lib tibia_data.ex
Raw

lib/tibia_data.ex

defmodule TibiaData do
@moduledoc """
Wrapper for the TibiaData API containing information from Tibia’s official homepage tibia.com, so you can build your own small tools.
"""
use HTTPoison.Base
def process_request_url(endpoint) do
"https://api.tibiadata.com/v2" <> endpoint <> ".json"
end
def process_response_body(body) do
body
|> Poison.decode!
|> Enum.map(fn({k, v}) -> {String.to_atom(k), v} end)
end
end