       find_at_least(tokens, [{["elixir"], 1}, {["rails"], 1}, {["want", "wants", "is", "why", "does"], 1}, {["?"], 1}]) ->
         "please don't make rails for Elixir please. https://twitter.com/thomasfuchs/status/457158363663843328"
 
+      find_at_least(tokens, [{["evm"], 1}, {["?"], 1}]) ->
+        random_from(@evm_replies)
+
+      find_at_least(tokens, [{["beamie"], 1}, {["actor"], 1}, {["model"], 1}]) ->
+        get_gosling_link()
+
       true -> nil
     end
     result && {:msg, result}
+  end
+
+  defp random_from(list, count \\ 0) do
+    if count == 0, do: count = length(list)
+    Enum.at(list, :random.uniform(count)-1)
   end
 
   def tokenize(text) do

defmodule TriviaHook do
  def run(_sender, text) do
    tokens = tokenize(text)
    result = cond do

    sub = if Enum.member?(tokens, word), do: 1, else: 0
    process_terms(t, tokens, count - sub)
  end


  defp get_gosling_link() do
    url = 'http://programmerryangosling.tumblr.com/random'
    result = :httpc.request(:head, {url, []}, [], [sync: true])
    case result do
      {:error, _reason} ->
        IO.inspect _reason
        nil
      {:ok, {status, headers, data} } ->
        #IO.inspect status
        #IO.inspect headers
        case status do
          {_, 301, _} ->
            new_url =
              List.keyfind(headers, 'location', 0)
              |> elem(1)
              |> List.to_string
              |> String.split("#")
              |> hd

            "actor model: " <> new_url

          _ -> nil
        end
    end
  end
end
