hs-twitter-0.2.5: Haskell binding to the Twitter API

Portabilityportable
Stabilityprovisional
MaintainerSigbjorn Finne <sof@forkIO.com>

Web.Twitter

Description

Toplevel module for the Twitter API, providing entry points to the various REST endpoints that twitter.com offer up

Synopsis

Documentation

getPublicTimeline :: TM [Status]Source

getPublicTimeline returns the 20 most recent statuses from non-protected users who have set a custom user icon

getFriendsTimeline :: Maybe DateString -> Maybe String -> TM [Status]Source

getFriendsTimeline mbSince mbSinceId returns the 20 most recent statuses posted by the authenticating user and that user's friends. Optionally constrained by start date or a status ID.

getUserTimeline :: Maybe String -> Maybe DateString -> Maybe String -> TM [Status]Source

getUserTimeline mbId mbSince mbSinceId returns the 20 most recent statuses posted from the authenticating user. It's also possible to request another user's timeline via the id parameter below.

showStatus :: String -> TM StatusSource

showStatus id returns a single status, specified by the id parameter. The status's author will be returned inline.

update :: String -> Maybe String -> TM ()Source

update text mbReplyToId updates the authenticating user's status to text.

getReplies :: Maybe DateString -> Maybe String -> TM [Status]Source

getReplies mbSince mbSinceId returns the 20 most recent @replies (status updates prefixed with @username) for the authenticating user.

destroyStatus :: String -> TM ()Source

destroyStatus id destroys the status specified by the id parameter. The authenticating user must be the author of the specified status.

getFriends :: Maybe String -> TM [Status]Source

getFriends mbId returns up to 100 of the authenticating user's friends who have most recently updated, each with current status inline. It's also possible to request another user's recent friends list via the mbId parameter.

getFollowers :: Maybe String -> TM [Status]Source

getFollowers mbId returns the authenticating user's followers, each with current status inline. They are ordered by the order in which they joined Twitter (this is going to be changed).

getUserInfo :: Maybe String -> Maybe String -> TM UserInfoSource

getUserInfo mbId mbEmail returns extended information of a given user, specified by ID or screen name as per the mbId parameter below. This information includes design settings, so third party developers can theme their widgets according to a given user's preferences. You must be properly authenticated to request the page of a protected user.

getDirectMessages :: Maybe DateString -> Maybe String -> TM [DirectMessage]Source

getDirectMesssages mbSince mbSinceId returns a list of the 20 most recent direct messages sent to the authenticating user.

getDirectMessagesSent :: Maybe DateString -> Maybe String -> TM [DirectMessage]Source

getDirectMessagesSent mbSince mbSinceId returns a list of the 20 most recent direct messages sent by the authenticating user.

sendDirectMessage :: UserId -> String -> TM DirectMessageSource

sendDirectMessage userId text sends a new direct message to the specified user from the authenticating user. Requires both the user and text parameters. Returns the sent message in the requested format when successful.

createFriend :: UserId -> Maybe Bool -> TM UserSource

createFriend id mbFollow befriends the user specified in the id parameter as the authenticating user. Returns the befriended user in the requested format when successful. Returns a string describing the failure condition when unsuccessful.

destroyFriend :: UserId -> TM UserSource

destroyFriend i discontinues friendship with the user specified in the id parameter as the authenticating user. Returns the un-friended user in the requested format when successful. Returns a string describing the failure condition when unsuccessful.

isFriendOf :: UserId -> UserId -> TM BoolSource

isFriendOf userA userB tests if a friendship exists between two users.

verifyCredentials :: TM UserSource

verifyCredentials returns an HTTP 200 OK response code and a representation of the requesting user if authentication was successful; returns a 401 status code and an error message if not. Use this method to test if supplied user credentials are valid.

endSession :: TM ()Source

endSession ends the session of the authenticating user, returning a null cookie. Use this method to sign users out of client-facing applications like widgets.

updateDeliveryDevice :: Maybe String -> TM ()Source

updateDeliveryService mbServ sets which device Twitter delivers updates to for the authenticating user. Sending Nothing as the device parameter will disable IM(im) or SMS(sms) updates.

updateProfileColors :: ProfileColors -> TM ()Source

updateProfileColors pc sets one or more hex values that control the color scheme of the authenticating user's profile page on twitter.com.

updateProfileImage :: FilePath -> TM ()Source

updateProfileImage imgFile updates the authenticating user's profile image. Expects raw multipart data, not a URL to an image.

updateProfileBackgroundImage :: FilePath -> TM ()Source

updateProfileBackgroundImage imgFile udates the authenticating user's profile background image. Expects raw multipart data, not a URL to an image.

data RateLimit Source

RateLimit bundles up the data that the getRateLimit Twitter API call returns regarding API call limits.

Instances

getRateLimit :: TM RateLimitSource

getRateLimit returns the remaining number of API requests available to the requesting user before the API limit is reached for the current hour. Calls to getRateLimit do not count against the rate limit. If authentication credentials are provided, the rate limit status for the authenticating user is returned. Otherwise, the rate limit status for the requester's IP address is returned.

updateProfile :: ProfileInfo -> TM ()Source

updateProfile profileInfo sets values that users are able to set under the Account tab of their settings page. Only the parameters specified will be updated; to only update the name attribute, for example, only include that as a Just value in the ProfileInfo parameter.

getFavorites :: Maybe UserId -> TM [Status]Source

getFavorites mbId returns the 20 most recent favorite statuses for the authenticating user or user specified by the mbId parameter.

createFavorite :: UserId -> TM UserSource

createFavorite id favorites the status specified in the id parameter as the authenticating user. Returns the favorite status when successful.

destroyFavorite :: UserId -> TM UserSource

destroyFavorite id un-favorites the status specified in the ID parameter as the authenticating user. Returns the un-favorited status in the requested format when successful.

followUser :: UserId -> TM UserSource

followUser id enables notifications for updates from the specified user to the authenticating user. Returns the specified user when successful.

leaveUser :: UserId -> TM UserSource

leaveUser id disables notifications for updates from the specified user to the authenticating user. Returns the specified user when successful.

createBlock :: UserId -> TM UserSource

createBlock id blocks the user specified in the id parameter as the authenticating user. Returns the blocked user.

destroyBlock :: UserId -> TM UserSource

destroyBlock id un-blocks the user specified in the id parameter as the authenticating user. Returns the un-blocked user.

testCall :: TM StringSource

testCall returns the string ok in the requested format with a 200 OK HTTP status code.

getTrends :: TM TrendsSource

testCall returns the string ok in the requested format with a 200 OK HTTP status code.

dropSearch :: SearchId -> IO ()Source