HN
A simple Hacker News API client in Elixir based on the official Firebase API.
Usage
Each endpoint (see API docs above) has a corresponding function call (and unsafe version), for example:
iex> HN.item(8863) # argument can be an integer or a string
{:ok, %HN.Item{
by: "dhouston",
dead: nil,
deleted: nil,
descendants: 71,
...
}}
# or
iex> HN.item!(8863)
%HN.Item{
by: "dhouston",
dead: nil,
deleted: nil,
descendants: 71,
...
}}
Installation
Add hn_ex
to your list of dependencies in mix.exs
:
def deps do
[
{:hn_ex, "~> 0.1"}
]
end