 defmodule FourOhFourFinderApp.PageAnalyzer do
   use HTTPoison.Base
+  require Logger
 
   def analyze(url) do
     case get_with_redirects(url) do

  end

  def redirect_location(headers) do
    elem(Enum.find(headers, fn({header, _}) -> "Location" == header end), 1)
  end

  def good_resp?(code) do

    case get(url) do
      {:ok, response} ->
        if redirect?(response.status_code) do
          Logger.debug("will redirect " <> redirect_location(response.headers))
          get_with_redirects(resolve_url(redirect_location(response.headers), url))
        else
          {:ok, response}
