Skip to content

Instantly share code, notes, and snippets.

@michaelsbradleyjr
Created May 24, 2012 04:06
Show Gist options
  • Save michaelsbradleyjr/2779361 to your computer and use it in GitHub Desktop.
Save michaelsbradleyjr/2779361 to your computer and use it in GitHub Desktop.
(ns learn-all-the-things)
(require 'clojure.xml)
(defn twitter-followers
[username]
(->> (str "https://api.twitter.com/1/users/show.xml?screen_name=" username)
clojure.xml/parse
:content
(filter (comp #{:followers_count} :tag))
first
:content
first Integer/parseInt))
(time (twitter-followers "excid3"))
;; "Elapsed time: 83.988 msecs"
;; => 748
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment