An Elixir wrapper for the Nationbuilder API, complete with API key cycling and more.
If available in Hex, the package can be installed
by adding nb to your list of dependencies in mix.exs:
def deps do
[
{:nb, "git://github.com/BrandNewCongress/nb_ex.git"}
]
endIn your config.exs, put
config :nb,
slug: "YOUR NATIONBUILDER SLUG",
keys: ["KEY 1", "KEY 2", "KEY 3"]And add Nb to your supervision tree
# List all child processes to be supervised
children = [
worker(Nb, []),
]And you're good to go!
%{"id" => id} = Nb.People.push(%{first_name: "Greg", last_name: "Greg", email: "greggreg@greg.edu"})
Nb.People.update(id, %{"phone" => "2147030845"})Clone the repository, and see doc/index.html.