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

Safe Haskell | None
Language | Haskell2010

Web.Twitter.Conduit.Stream

Contents

- StreamingAPI

Synopsis

- type Userstream = '["language" := Text, "filter_level" := Text, "stall_warnings" := Bool, "replies" := Text]
- userstream :: APIRequest Userstream StreamingAPI
- type StatusesFilter = '["language" := Text, "filter_level" := Text, "stall_warnings" := Bool]
- data FilterParameter
  - = Follow [UserId]
  - | Track [Text]
- statusesFilter :: [FilterParameter] -> APIRequest StatusesFilter StreamingAPI
- statusesFilterByFollow :: [UserId] -> APIRequest StatusesFilter StreamingAPI
- statusesFilterByTrack :: Text -> APIRequest StatusesFilter StreamingAPI
- stream :: (MonadResource m, FromJSON responseType, MonadThrow m) => TWInfo -> Manager -> APIRequest apiName responseType -> m (ConduitM () responseType m ())
- stream' :: (MonadResource m, FromJSON value, MonadThrow m) => TWInfo -> Manager -> APIRequest apiName responseType -> m (ConduitM () value m ())

# StreamingAPI

type Userstream = '["language" := Text, "filter_level" := Text, "stall_warnings" := Bool, "replies" := Text] Source #

userstream :: APIRequest Userstream StreamingAPI Source #

type StatusesFilter = '["language" := Text, "filter_level" := Text, "stall_warnings" := Bool] Source #

data FilterParameter Source #

Constructors

Follow [UserId] |
Track [Text] |

statusesFilter :: [FilterParameter] -> APIRequest StatusesFilter StreamingAPI Source #

Returns statuses/filter.json API query data.

    >>> statusesFilter [Follow [1,2,3]]
    APIRequest "POST" "https://stream.twitter.com/1.1/statuses/filter.json" [("follow","1,2,3")]
    >>> statusesFilter [Track ["haskell","functional"]]
    APIRequest "POST" "https://stream.twitter.com/1.1/statuses/filter.json" [("track","haskell,functional")]
    >>> statusesFilter [Follow [1,2,3],Track ["haskell","functional"]]
    APIRequest "POST" "https://stream.twitter.com/1.1/statuses/filter.json" [("follow","1,2,3"),("track","haskell,functional")]

statusesFilterByFollow :: [UserId] -> APIRequest StatusesFilter StreamingAPI Source #

Returns statuses/filter.json API query data.

    >>> statusesFilterByFollow [1,2,3]
    APIRequest "POST" "https://stream.twitter.com/1.1/statuses/filter.json" [("follow","1,2,3")]

statusesFilterByTrack Source #

Arguments

:: Text | keyword
-> APIRequest StatusesFilter StreamingAPI |

Returns statuses/filter.json API query data.

    >>> statusesFilterByTrack "haskell"
    APIRequest "POST" "https://stream.twitter.com/1.1/statuses/filter.json" [("track","haskell")]

stream :: (MonadResource m, FromJSON responseType, MonadThrow m) => TWInfo -> Manager -> APIRequest apiName responseType -> m (ConduitM () responseType m ()) Source #

stream' :: (MonadResource m, FromJSON value, MonadThrow m) => TWInfo -> Manager -> APIRequest apiName responseType -> m (ConduitM () value m ()) Source #