joshrotenberg / hn_ex

A Hacker News API Client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HN

github.com hex.pm hex.pm hex.pm hex.pm github.com

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

About

A Hacker News API Client

License:MIT License


Languages

Language:Elixir 100.0%