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

Safe Haskell | None
Language | Haskell2010

Web.Twitter.Conduit.Types

Synopsis

- data TWToken = TWToken {
  - twOAuth :: OAuth
  - twCredential :: Credential
  }
- data TWInfo = TWInfo {
  - twToken :: TWToken
  - twProxy :: Maybe Proxy
  }
- twitterOAuth :: OAuth
- setCredential :: OAuth -> Credential -> TWInfo -> TWInfo

# Documentation

data TWToken Source #

Constructors

TWToken |

Fields

- twOAuth :: OAuth
- twCredential :: Credential

Instances

Eq TWToken Source # |
Methods (==) :: TWToken -> TWToken -> Bool # (/=) :: TWToken -> TWToken -> Bool #
Read TWToken Source # |
Methods readsPrec :: Int -> ReadS TWToken # readList :: ReadS [TWToken] # readPrec :: ReadPrec TWToken # readListPrec :: ReadPrec [TWToken] #
Show TWToken Source # |
Methods showsPrec :: Int -> TWToken -> ShowS # show :: TWToken -> String # showList :: [TWToken] -> ShowS #
Default TWToken Source # |
Methods def :: TWToken #

data TWInfo Source #

Constructors

TWInfo |

Fields

- twToken :: TWToken
- twProxy :: Maybe Proxy

Instances

Eq TWInfo Source # |
Methods (==) :: TWInfo -> TWInfo -> Bool # (/=) :: TWInfo -> TWInfo -> Bool #
Read TWInfo Source # |
Methods readsPrec :: Int -> ReadS TWInfo # readList :: ReadS [TWInfo] # readPrec :: ReadPrec TWInfo # readListPrec :: ReadPrec [TWInfo] #
Show TWInfo Source # |
Methods showsPrec :: Int -> TWInfo -> ShowS # show :: TWInfo -> String # showList :: [TWInfo] -> ShowS #
Default TWInfo Source # |
Methods def :: TWInfo #

twitterOAuth :: OAuth Source #

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