Last active
December 18, 2015 10:39
-
-
Save jeremyheiler/5770079 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require '[paprika.core :as adn]) | |
;; This returns a sequence your of vectors, one for each of the people you follow. | |
;; Each vector contains the user's username and the date of their last post. | |
;; The sequence is in ascending order by the date of their last post | |
;; Careful, though. The lookup is N+1. | |
(sort-by first | |
(map (juxt :created-at #(get-in % [:user :username])) | |
(apply concat | |
(map #(adn/lookup-user-posts % {:count 1 :access-token t})) | |
(adn/lookup-following-ids "me" {:access-token t})))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(->> (:data (p/lookup-following-ids "me" {:token t})) (map #(:data (p/lookup-user-posts % {:count 1 :token t}))) (apply concat) (map (juxt :created-at #(get-in % [:user :username]))) (sort-by first))