Current section

Files

Jump to
display_purposes lib display_purposes.ex
Raw

lib/display_purposes.ex

defmodule DisplayPurposes do
@moduledoc """
Display Purposes API wrapper
Use the `tags/3` function
"""
use HTTPoison.Base
@doc """
Get relevant hashtags for `word`
"""
def tags(word, headers \\ [], options \\ []) when is_binary(word) and is_list(headers) and is_list(options) do
get(word, headers, options)
end
@doc false
def process_request_url(url) do
"https://query.displaypurposes.com/tag/" <> url
end
@doc false
def process_response_body(body) do
body |> Jason.decode!()
end
end