Portability | portable |
---|---|
Stability | provisional |
Maintainer | Sigbjorn Finne <sof@forkIO.com> |
Toplevel module for the Twitter API, providing entry points to the various REST endpoints that twitter.com offer up
- getPublicTimeline :: TM [Status]
- getFriendsTimeline :: Maybe DateString -> Maybe String -> TM [Status]
- getUserTimeline :: Maybe String -> Maybe DateString -> Maybe String -> TM [Status]
- showStatus :: String -> TM Status
- update :: String -> Maybe String -> TM ()
- getReplies :: Maybe DateString -> Maybe String -> TM [Status]
- destroyStatus :: String -> TM ()
- getFriends :: Maybe String -> TM [Status]
- getFollowers :: Maybe String -> TM [Status]
- getUserInfo :: Maybe String -> Maybe String -> TM UserInfo
- getDirectMessages :: Maybe DateString -> Maybe String -> TM [DirectMessage]
- getDirectMessagesSent :: Maybe DateString -> Maybe String -> TM [DirectMessage]
- sendDirectMessage :: UserId -> String -> TM DirectMessage
- destroyDirectMessage :: UserId -> TM ()
- createFriend :: UserId -> Maybe Bool -> TM User
- destroyFriend :: UserId -> TM User
- isFriendOf :: UserId -> UserId -> TM Bool
- verifyCredentials :: TM User
- endSession :: TM ()
- updateDeliveryDevice :: Maybe String -> TM ()
- data ProfileColors = ProfileColors {}
- nullProfileColors :: ProfileColors
- updateProfileColors :: ProfileColors -> TM ()
- updateProfileImage :: FilePath -> TM ()
- updateProfileBackgroundImage :: FilePath -> TM ()
- data RateLimit = RateLimit {}
- nullRateLimit :: RateLimit
- getRateLimit :: TM RateLimit
- data ProfileInfo = ProfileInfo {}
- nullProfileInfo :: ProfileInfo
- updateProfile :: ProfileInfo -> TM ()
- getFavorites :: Maybe UserId -> TM [Status]
- createFavorite :: UserId -> TM User
- destroyFavorite :: UserId -> TM User
- followUser :: UserId -> TM User
- leaveUser :: UserId -> TM User
- createBlock :: UserId -> TM User
- destroyBlock :: UserId -> TM User
- testCall :: TM String
- search :: SearchContext -> TM [SearchResult]
- getTrends :: TM Trends
- data SearchContext = SearchContext {
- searchLang :: String
- searchRPP :: Int
- searchPage :: Int
- searchSinceId :: StatusId
- searchGeocode :: String
- searchShowUser :: Bool
- searchQuery :: String
- searchHashTag :: String
- searchFromUser :: UserName
- searchToUser :: UserName
- searchReferring :: UserName
- searchAllWords :: [String]
- searchAnyWords :: [String]
- searchNoneWords :: [String]
- searchPhrase :: String
- searchNear :: String
- searchFor :: SearchContext
- setUpdateInterval :: IO ()
- setTwitterUser :: IO ()
- tweet :: String -> IO ()
- stopUpdates :: IO ()
- addSearchFilter :: SearchContext -> IO SearchId
- dropSearch :: SearchId -> IO ()
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.
destroyDirectMessage :: UserId -> TM ()Source
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.
data ProfileColors Source
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.
RateLimit
bundles up the data that the getRateLimit
Twitter API call returns regarding API call limits.
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.
data ProfileInfo Source
updateProfile :: ProfileInfo -> TM ()Source
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
returns the string ok in the requested format
with a 200 OK HTTP status code.
search :: SearchContext -> TM [SearchResult]Source
testCall
returns the string ok in the requested format
with a 200 OK HTTP status code.
data SearchContext Source
SearchContext | |
|
addSearchFilter :: SearchContext -> IO SearchIdSource
dropSearch :: SearchId -> IO ()Source