   [resp k]
   (some #(when (and (vector? %) (= (first %) k)) %) resp))
 
-(defn check-feed!
-  [_ db feed feed-idx]
+(defn fetch-feed-entries!
+  [db feed]
   (log/debug "Checking feed:" feed)
   (when-let [resp (tagsoup/parse feed)]
-    (hash-map :idx feed-idx
-              :chan-id (-> resp (find-element :channelId) (last))
+    (hash-map :chan-id (-> resp (find-element :channelId) (last))
               :author  (-> resp (find-element :author) (find-element :name) (last))
               :entries (map #(hash-map :id (-> % (find-element :videoId) (last))
                                        :title (-> % (find-element :title) (last))

  (:require [com.stuartsierra.component :as component]
            [taoensso.timbre :as log]
            [espdig.components.db :as db]
            [pl.danieljanus.tagsoup :as tagsoup]))

(def tbl-name "yt_videos")
(def running? (atom false))


(defn start-loop!
  [db feeds]
  (async/go-loop []
    (loop [remaining-feeds feeds]
      (when-let [feed (first remaining-feeds)]
        (let [{:keys [chan-id author entries]} (fetch-feed-entries! db feed)]
          (doseq [entry entries]
            (println "Found entry" (:id entry))))
        (recur [(next remaining-feeds)])))
    (Thread/sleep 10000) ;; 10 secs
    (when @running?
      (recur))))

(defn create-schema!
  [db]
