Created
January 23, 2012 07:46
-
-
Save jrwest/1661442 to your computer and use it in GitHub Desktop.
Call StackMob API from Haskell
This file contains 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
-- requires hoauth http://hackage.haskell.org/package/hoauth | |
import Network.OAuth.Consumer | |
import Network.OAuth.Http.CurlHttpClient | |
import Network.OAuth.Http.Request (parseURL) | |
import Network.OAuth.Http.Response | |
import Data.Maybe (fromJust) | |
reqUrl = fromJust . parseURL $ "http://SUBDOMAIN.stackmob.com/api/0/APPNAME/listapi" | |
app = Application "public key" "private key" OOB | |
response :: IO Response | |
response = runOAuthM (fromApplication app) $ do | |
req <- signRq2 HMACSHA1 Nothing reqUrl | |
serviceRequest CurlClient req |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment