Skip to content

Instantly share code, notes, and snippets.

@jeremyheiler
Last active December 18, 2015 10:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeremyheiler/5770079 to your computer and use it in GitHub Desktop.
Save jeremyheiler/5770079 to your computer and use it in GitHub Desktop.
(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}))))
@jeremyheiler
Copy link
Author

(->> (: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))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment