 
         deja-downloaded-file (string/replace thread-ids-file
                                              #".threads$"
-                                             ".downloaded")
-        
-        downloaded (if (.exists
-                        (io/as-file deja-downloaded-file))
-                     (set
-                      (string/split-lines
-                       (slurp deja-downloaded-file)))
-                     (set []))]
+                                             ".downloaded")]
     (if-not (.exists
              (io/as-file file-to-write))
       

  []
  (let [threads-listing (str core/disqus-jobs-dir "all.threads")
        downloaded-listing (if (.exists
                                (io/as-file "all.downloaded"))
                            (set
                             (string/split-lines
                              (slurp "all.downloaded")))
                            (set []))
        thread-stream (with-open [rdr (io/reader threads-listing)]
                        (doall

(defn download-posts
  "Download all the posts for a single thread"
  [thread-id file-to-write api-key]
  (let [url (create-url-2 thread-id
                          api-key)
        first-page-content (core/rate-limited-download url)]
    (write-content file-to-write first-page-content)
    (discover-iteration thread-id file-to-write first-page-content api-key)))
