Created
June 29, 2010 19:19
-
-
Save sadache/457652 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
simpleGet uri error ok = | |
do resp <- simpleHTTP req | |
either error | |
(\r -> | |
case rspCode r of | |
(2,_,_) -> ok (rspBody r)) | |
resp | |
where req=request urii | |
urii =fromJust $ parseURI uri | |
getSadacheProfile= do simpleGet | |
"http://api.twitter.com/1/users/show.json?id=sadache" | |
(\error -> print ("Error connecting: " ++ show error)) | |
(\r -> print $ (valFromObj "statuses_count" | |
=<< decode r :: Result Int)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment