Created
May 24, 2012 04:06
-
-
Save michaelsbradleyjr/2779361 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
(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