 defmodule Glasnost.Worker.AuthorSync do
   use GenServer
-  alias Glasnost.{Repo, RuntimeConfig}
+  alias Glasnost.{Repo, RuntimeConfig, PostFilters, Post}
   import Logger
 
   def start_link(args, opts \\ []) do


  def extract_put_tags(post) do
     put_in(post, ["tags"], post["json_metadata"]["tags"])
  end

  def iterate(posts, state) do

     posts = posts
      |> Enum.map(&parse_json_metadata/1)
      |> Enum.map(&extract_put_tags/1)
      |> Post.filter_by(:tags, filters[:tags])
      |> Post.filter_by(:title, filters[:title])
      |> Post.filter_by(:created, filters[:created])

     for post <- posts do
       save_to_db(post)
