Uses the XKCD JSON API to retrieve a random, specific or the latest comic
If available in Hex, the package can be installed as:
-
Add xkcd to your list of dependencies in
mix.exs
:def deps do [{:xkcd, "~> 0.0.1"}] end
-
Ensure xkcd is started before your application:
def application do [applications: [:xkcd]] end
iex> Xkcd.latest
{:ok, %Xkcd.Comic{...}}
iex> Xkcd.random
{:ok, %Xkcd.Comic{...}}
iex> Xkcd.number(256)
{:ok, %Xkcd.Comic{...}}