;; Needs tentacles: https://github.com/Raynes/tentacles
(require '[tentacles.orgs :as orgs]
         '[tentacles.users :as users])

(defn percentile
  "If you were a Github employee, what percentile would your user ID be?"
  [username]
  (let [id (:id (users/user username))
        hubbers (orgs/members "github")
        older (filter (partial > id) (map :id hubbers))]
    (int (* 100 (/ (count older) (count hubbers))))))

(percentile "indirect") ; => 16
(percentile "technomancy") ; => 20
(percentile "watsonian") ; => 25

Generated by Phil Hagelberg using scpaste at Thu Dec 15 11:12:17 2011. PST. (original)