clit-0.2.2.4: Post tweets from stdin

Safe HaskellNone
LanguageHaskell2010

Web.Tweet

Contents

Description

Various utilities to tweet using the twitter api

Make sure you have a file credentials file (default the executable looks for is `.cred`) with the following info:

api-key: API_KEY

api-sec: API_SECRE

tok: OAUTH_TOKEN

tok-sec: TOKEN_SECRET

Synopsis

Functions to tweet

basicTweet :: String -> FilePath -> IO Int Source #

Tweet a string given a path to credentials; return the id of the status.

basicTweet "On the airplane." ".cred"

tweetData :: Tweet -> FilePath -> IO Int Source #

tweet, given a Tweet and path to credentials. Return id of posted tweet.

thread :: String -> [String] -> Maybe Int -> Int -> FilePath -> IO () Source #

thread tweets together nicely. Takes a string, a list of handles to reply to, plus the ID of the status you're replying to. If you need to thread tweets without replying, pass a Nothing as the third argument.

thread "Hi I'm back in New York!" ["friend1","friend2"] Nothing 1 ".cred"

Data type for a tweet

data Tweet Source #

Data type for our request: consists of the status text, whether to trium user information in the response, the handles to mention, and optionally the id of the status to reply to.

Constructors

Tweet 

Functions to sign API requests

signRequest :: FilePath -> Request -> IO Request Source #

Sign a request using your OAuth dev token. Uses the IO monad because signatures require a timestamp

Functions to generate a URL string from a Tweet

urlString :: Tweet -> String Source #

Convert a tweet to a percent-encoded url for querying an API