   def get_info(id) when is_binary(id) do
     stop = String.rjust(id,5,?0)
 
-    body = HTTPoison.get(@info_url <> stop)
+    {:ok, body} = HTTPoison.get(@info_url <> stop)
     |> get_body
 
     timetable = Floki.find(body,".gridRow")

  @spec search(String.t) :: list(stop)
  def search(query) do

    HTTPoison.get(@search_url <> query)
    |> get_body
    |> Floki.find("#GridViewStopResults")
    |> hd        # get the only element
    |> Tuple.to_list
    |> List.last # look for the children of the table (tr)
    |> tl        # discard the header
    |> Enum.map(&parse_stop/1)
    |> Enum.reject(&is_nil(&1))

  end

  defp get_body({:ok,
                 %HTTPoison.Response{status_code: 200,
                                     body: body}}) do
    body
  end


  defp parse_stop({"tr", _ ,
                   [{"td",_ , [line]},


  @info_url "http://rtpi.ie/Popup_Content/WebDisplay/WebDisplay.aspx?stopRef="
  @search_url  "http://rtpi.ie/Text/StopResults.aspx?did=-1&search="
  @regex Regex.compile!("stopRef=(?<stop>.*)\&stopName")


  @typedoc """
