twitter-conduit-0.0.6: Twitter API package with conduit interface and Streaming API support.

Safe HaskellNone
LanguageHaskell98

Web.Twitter.Conduit.Monad

Synopsis

Documentation

type TW m = ReaderT TWEnv m Source

data TWToken Source

Constructors

TWToken 

data TWInfo Source

Constructors

TWInfo 

setCredential :: OAuth -> Credential -> TWInfo -> TWInfo Source

set OAuth keys and Credentials to TWInfo.

>>> let proxy = Proxy "localhost" 8080
>>> let twinfo = def { twProxy = Just proxy }
>>> let oauth = twitterOAuth { oauthConsumerKey = "consumer_key", oauthConsumerSecret = "consumer_secret" }
>>> let credential = Credential [("oauth_token","...")]
>>> let twinfo2 = setCredential oauth credential twinfo
>>> oauthConsumerKey . twOAuth . twToken $ twinfo2
"consumer_key"
>>> twProxy twinfo2 == Just proxy
True

runTW :: (MonadBaseControl IO m, MonadIO m) => TWInfo -> TW (ResourceT m) a -> m a Source

create a new http-conduit manager and run TW monad.

>>> runTW def getProxy
Nothing
>>> runTW def $ asks (twCredential . twToken . twInfo)
Credential {unCredential = []}