 
   def init(:ok) do
     HTTPoison.start
-    start_timer
+    #    start_timer
     {:ok, %{}}
   end
 

  # Scan rss feed for matching patterns
  defp scan_feed do
    # Get and parse feed
    url = "http://www.nyaa.se/?page=rss&term=horrible"
    {:ok, %HTTPoison.Response{body: body}} = HTTPoison.get(url)
    {:ok, feed, _} = FeederEx.parse(body)

    # Search feed for pattern
    matches = Enum.filter(feed.entries, fn(e) -> check(e, ~r/Fate/) end )
    match = List.first(matches)

    # Download torrent
    %HTTPoison.Response{body: body} = HTTPoison.get!(match.link)
    File.write!("/tmp/" <> match.title <> ".torrent", body)
  end

  # Check if element matches pattern
  defp check(element, pattern) do
    if String.match?(element.title, pattern) do
      element.link
    end


  # Activate "scan_feed" after 15min pass
  defp start_timer do
    Process.send_after(self, :scan_feed, ( 15 * 60000 ) )
  end

end
