Exkismet is a simple Elixir client for the Akismet.com spam detection API.
The package can be installed as:
-
Add exkismet to your list of dependencies in
mix.exs
:def deps do [{:exkismet, "~> 0.0.2"}] end
-
Ensure exkismet is started before your application:
def application do [applications: [:exkismet]] end
-
Add the following line to your
config.exs
file:config :exkismet, key: "<your api key>", blog: "http://<yourhosturl>"
iex -S mix
iex(1)> Exkismet.Api.verify
:valid
iex(2)>
Exkismet.Api.comment_check(%{...})
returns :ham
, if the comment appears to be ok, :spam
if it's suspicious, and
:discard
if Akismet is 100% certain that it's looking at spam.
Exkismet.Api.submit_spam(%{...})
Exkismet.Api.submit_ham(%{...})