Skip to content

Instantly share code, notes, and snippets.

@mcav
Last active December 13, 2015 20:28
Show Gist options
  • Save mcav/4969790 to your computer and use it in GitHub Desktop.
Save mcav/4969790 to your computer and use it in GitHub Desktop.
(defn export-twitter-archive []
(->> (for [f (.listFiles (io/file "tweets/data/js/tweets"))
:when (.endsWith (.getName f) ".js")]
(for [tweet (json/read-str (second (str/split (slurp f) #"=" 2)) :key-fn keyword)]
(assoc tweet
:date (java.util.Date. (:created_at tweet)))))
(apply concat)
(sort-by :date)
reverse))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment