Safe Haskell | None |
---|
- data SearchTweets
- searchTweets :: Text -> APIRequest SearchTweets (SearchResult [SearchStatus])
- search :: Text -> APIRequest SearchTweets (SearchResult [SearchStatus])
- data DirectMessages
- directMessages :: APIRequest DirectMessages [DirectMessage]
- data DirectMessagesSent
- directMessagesSent :: APIRequest DirectMessagesSent [DirectMessage]
- data DirectMessagesShow
- directMessagesShow :: StatusId -> APIRequest DirectMessagesShow DirectMessage
- data DirectMessagesDestroy
- directMessagesDestroy :: StatusId -> APIRequest DirectMessagesDestroy DirectMessage
- data DirectMessagesNew
- directMessagesNew :: UserParam -> Text -> APIRequest DirectMessagesNew DirectMessage
- data FriendshipsNoRetweetsIds
- friendshipsNoRetweetsIds :: APIRequest FriendshipsNoRetweetsIds [UserId]
- data FriendsIds
- friendsIds :: UserParam -> APIRequest FriendsIds (WithCursor IdsCursorKey UserId)
- data FollowersIds
- followersIds :: UserParam -> APIRequest FollowersIds (WithCursor IdsCursorKey UserId)
- data FriendshipsIncoming
- friendshipsIncoming :: APIRequest FriendshipsIncoming (WithCursor IdsCursorKey UserId)
- data FriendshipsOutgoing
- friendshipsOutgoing :: APIRequest FriendshipsOutgoing (WithCursor IdsCursorKey UserId)
- data FriendshipsCreate
- friendshipsCreate :: UserParam -> APIRequest FriendshipsCreate User
- data FriendshipsDestroy
- friendshipsDestroy :: UserParam -> APIRequest FriendshipsDestroy User
- data FriendsList
- friendsList :: UserParam -> APIRequest FriendsList (WithCursor UsersCursorKey User)
- data AccountVerifyCredentials
- accountVerifyCredentials :: APIRequest AccountVerifyCredentials User
- data UsersLookup
- usersLookup :: UserListParam -> APIRequest UsersLookup [User]
- data UsersShow
- usersShow :: UserParam -> APIRequest UsersShow User
- data FavoritesList
- favoritesList :: Maybe UserParam -> APIRequest FavoritesList [Status]
- data FavoritesDestroy
- favoritesDestroy :: StatusId -> APIRequest FavoritesDestroy Status
- data FavoritesCreate
- favoritesCreate :: StatusId -> APIRequest FavoritesCreate Status
- data ListsMembers
- listsMembers :: ListParam -> APIRequest ListsMembers (WithCursor UsersCursorKey User)
- data MediaUpload
- mediaUpload :: MediaData -> APIRequest MediaUpload UploadedMedia
Search
data SearchTweets Source
:: Text | search string |
-> APIRequest SearchTweets (SearchResult [SearchStatus]) |
Returns search query.
You can perform a search query using call
:
res <-call
(searchTweets
"search text")liftIO
.searchResultStatuses
>>>
searchTweets "search text"
APIRequestGet "https://api.twitter.com/1.1/search/tweets.json" [("q","search text")]>>>
searchTweets "search text" & lang ?~ "ja" & count ?~ 100
APIRequestGet "https://api.twitter.com/1.1/search/tweets.json" [("count","100"),("lang","ja"),("q","search text")]
:: Text | search string |
-> APIRequest SearchTweets (SearchResult [SearchStatus]) |
Alias of searchTweets
, for backward compatibility
Direct Messages
data DirectMessages Source
directMessages :: APIRequest DirectMessages [DirectMessage]Source
Returns query data which asks recent direct messages sent to the authenticating user.
You can perform a query using call
:
res <-call
$
directMessages
&
count
?~
100
>>>
directMessages
APIRequestGet "https://api.twitter.com/1.1/direct_messages.json" []>>>
directMessages & count ?~ 100
APIRequestGet "https://api.twitter.com/1.1/direct_messages.json" [("count","100")]
data DirectMessagesSent Source
directMessagesSent :: APIRequest DirectMessagesSent [DirectMessage]Source
Returns query data which asks recent direct messages sent by the authenticating user.
You can perform a query using call
:
res <-call
$
directMessagesSent
&
count
?~
100
>>>
directMessagesSent
APIRequestGet "https://api.twitter.com/1.1/direct_messages/sent.json" []>>>
directMessagesSent & count ?~ 100
APIRequestGet "https://api.twitter.com/1.1/direct_messages/sent.json" [("count","100")]
data DirectMessagesShow Source
directMessagesShow :: StatusId -> APIRequest DirectMessagesShow DirectMessageSource
Returns query data which asks a single direct message, specified by an id parameter.
You can perform a query using call
:
res <-call
$
directMessagesShow
1234567890
>>>
directMessagesShow 1234567890
APIRequestGet "https://api.twitter.com/1.1/direct_messages/show.json" [("id","1234567890")]
directMessagesDestroy :: StatusId -> APIRequest DirectMessagesDestroy DirectMessageSource
Returns post data which destroys the direct message specified in the required ID parameter.
You can perform a query using call
:
res <-call
$
directMessagesDestroy
1234567890
>>>
directMessagesDestroy 1234567890
APIRequestPost "https://api.twitter.com/1.1/direct_messages/destroy.json" [("id","1234567890")]
data DirectMessagesNew Source
directMessagesNew :: UserParam -> Text -> APIRequest DirectMessagesNew DirectMessageSource
Returns post data which sends a new direct message to the specified user from the authenticating user.
You can perform a post using call
:
res <-call
$
directMessagesNew
(ScreenNameParam "thimura") "Hello DM"
>>>
directMessagesNew (ScreenNameParam "thimura") "Hello DM"
APIRequestPost "https://api.twitter.com/1.1/direct_messages/new.json" [("text","Hello DM"),("screen_name","thimura")]>>>
directMessagesNew (UserIdParam 69179963) "Hello thimura! by UserId"
APIRequestPost "https://api.twitter.com/1.1/direct_messages/new.json" [("text","Hello thimura! by UserId"),("user_id","69179963")]
Friends & Followers
friendshipsNoRetweetsIds :: APIRequest FriendshipsNoRetweetsIds [UserId]Source
Returns a collection of user_ids that the currently authenticated user does not want to receive retweets from.
You can perform a request using call
:
res <-call
$
friendshipsNoRetweetsIds
>>>
friendshipsNoRetweetsIds
APIRequestGet "https://api.twitter.com/1.1/friendships/no_retweets/ids.json" []
data FriendsIds Source
friendsIds :: UserParam -> APIRequest FriendsIds (WithCursor IdsCursorKey UserId)Source
Returns query data which asks a collection of user IDs for every user the specified user is following.
You can perform a query using call
:
res <-call
$
friendsIds
(ScreenNameParam
"thimura")
Or, you can iterate with sourceWithCursor
:
sourceWithCursor
(friendsIds
(ScreenNameParam
"thimura")) $$ CL.consume
>>>
friendsIds (ScreenNameParam "thimura")
APIRequestGet "https://api.twitter.com/1.1/friends/ids.json" [("screen_name","thimura")]>>>
friendsIds (ScreenNameParam "thimura") & count ?~ 5000
APIRequestGet "https://api.twitter.com/1.1/friends/ids.json" [("count","5000"),("screen_name","thimura")]
data FollowersIds Source
followersIds :: UserParam -> APIRequest FollowersIds (WithCursor IdsCursorKey UserId)Source
Returns query data which asks a collection of user IDs for every user following the specified user.
You can perform a query using call
:
res <-call
$
followersIds
(ScreenNameParam
"thimura")
Or, you can iterate with sourceWithCursor
:
sourceWithCursor
(followersIds
(ScreenNameParam
"thimura")) $$ CL.consume
>>>
followersIds (ScreenNameParam "thimura")
APIRequestGet "https://api.twitter.com/1.1/followers/ids.json" [("screen_name","thimura")]>>>
followersIds (ScreenNameParam "thimura") & count ?~ 5000
APIRequestGet "https://api.twitter.com/1.1/followers/ids.json" [("count","5000"),("screen_name","thimura")]
friendshipsIncoming :: APIRequest FriendshipsIncoming (WithCursor IdsCursorKey UserId)Source
Returns a collection of numeric IDs for every user who has a pending request to follow the authenticating user.
You can perform a request by using call
:
res <-call
$
friendshipsIncoming
Or, you can iterate with sourceWithCursor
:
sourceWithCursor
friendshipsIncoming
$$ CL.consume
>>>
friendshipsIncoming
APIRequestGet "https://api.twitter.com/1.1/friendships/incoming.json" []
friendshipsOutgoing :: APIRequest FriendshipsOutgoing (WithCursor IdsCursorKey UserId)Source
Returns a collection of numeric IDs for every protected user for whom the authenticating user has a pending follow request.
You can perform a request by using call
:
res <-call
$
friendshipsOutgoing
Or, you can iterate with sourceWithCursor
:
sourceWithCursor
friendshipsOutgoing
$$ CL.consume
>>>
friendshipsOutgoing
APIRequestGet "https://api.twitter.com/1.1/friendships/outgoing.json" []
friendshipsCreate :: UserParam -> APIRequest FriendshipsCreate UserSource
Returns post data which follows the user specified in the ID parameter.
You can perform request by using call
:
res <-call
$
friendshipsCreate
(ScreenNameParam
"thimura")
>>>
friendshipsCreate (ScreenNameParam "thimura")
APIRequestPost "https://api.twitter.com/1.1/friendships/create.json" [("screen_name","thimura")]>>>
friendshipsCreate (UserIdParam 69179963)
APIRequestPost "https://api.twitter.com/1.1/friendships/create.json" [("user_id","69179963")]
data FriendshipsDestroy Source
friendshipsDestroy :: UserParam -> APIRequest FriendshipsDestroy UserSource
Returns post data which follows the user specified in the ID parameter.
You can perform request by using call
:
res <-call
$
friendshipsDestroy
(ScreenNameParam
"thimura")
>>>
friendshipsDestroy (ScreenNameParam "thimura")
APIRequestPost "https://api.twitter.com/1.1/friendships/destroy.json" [("screen_name","thimura")]>>>
friendshipsDestroy (UserIdParam 69179963)
APIRequestPost "https://api.twitter.com/1.1/friendships/destroy.json" [("user_id","69179963")]
data FriendsList Source
friendsList :: UserParam -> APIRequest FriendsList (WithCursor UsersCursorKey User)Source
Returns query data which asks a cursored collection of user objects for every user the specified users is following.
You can perform request by using call
:
res <-call
$
friendsList
(ScreenNameParam
"thimura")
Or, you can iterate with sourceWithCursor
:
sourceWithCursor
(friendsList
(ScreenNameParam
"thimura")) $$ CL.consume
>>>
friendsList (ScreenNameParam "thimura")
APIRequestGet "https://api.twitter.com/1.1/friends/list.json" [("screen_name","thimura")]>>>
friendsList (UserIdParam 69179963)
APIRequestGet "https://api.twitter.com/1.1/friends/list.json" [("user_id","69179963")]
Users
accountVerifyCredentials :: APIRequest AccountVerifyCredentials UserSource
Returns query data asks that the credential is valid.
You can perform request by using call
:
res <-call
$
accountVerifyCredentials
>>>
accountVerifyCredentials
APIRequestGet "https://api.twitter.com/1.1/account/verify_credentials.json" []
usersLookup :: UserListParam -> APIRequest UsersLookup [User]Source
Returns query data asks user objects.
You can perform request by using call
:
res <-call
$
usersLookup
(ScreenNameListParam
["thimura", "twitterapi"])
>>>
usersLookup (ScreenNameListParam ["thimura", "twitterapi"])
APIRequestGet "https://api.twitter.com/1.1/users/lookup.json" [("screen_name","thimura,twitterapi")]
usersShow :: UserParam -> APIRequest UsersShow UserSource
Returns query data asks the user specified by user id or screen name parameter.
You can perform request by using call
:
res <-call
$
usersShow
(ScreenNameParam
"thimura")
>>>
usersShow (ScreenNameParam "thimura")
APIRequestGet "https://api.twitter.com/1.1/users/show.json" [("screen_name","thimura")]
Suggested Users
Favorites
data FavoritesList Source
favoritesList :: Maybe UserParam -> APIRequest FavoritesList [Status]Source
Returns the 20 most recent Tweets favorited by the specified user.
You can perform request by using call
:
res <-call
$
favoritesList
(ScreenNameParam "thimura")
>>>
favoritesList Nothing
APIRequestGet "https://api.twitter.com/1.1/favorites/list.json" []>>>
favoritesList (Just (ScreenNameParam "thimura"))
APIRequestGet "https://api.twitter.com/1.1/favorites/list.json" [("screen_name","thimura")]>>>
favoritesList (Just (UserIdParam 69179963))
APIRequestGet "https://api.twitter.com/1.1/favorites/list.json" [("user_id","69179963")]
favoritesDestroy :: StatusId -> APIRequest FavoritesDestroy StatusSource
Returns post data unfavorites the status specified in the ID paramter as the authenticating user.
You can perform request by using call
:
res <-call
$
favoritesDestroy
1234567890
>>>
favoritesDestroy 1234567890
APIRequestPost "https://api.twitter.com/1.1/favorites/destroy.json" [("id","1234567890")]
favoritesCreate :: StatusId -> APIRequest FavoritesCreate StatusSource
Returns post data which favorites the status specified in the ID parameter as the authenticating user.
You can perform request by using call
:
res <-call
$
favoritesCreate
1234567890
>>>
favoritesCreate 1234567890
APIRequestPost "https://api.twitter.com/1.1/favorites/create.json" [("id","1234567890")]
Lists
data ListsMembers Source
listsMembers :: ListParam -> APIRequest ListsMembers (WithCursor UsersCursorKey User)Source
Returns query data asks the members of the specified list.
You can perform request by using call
:
res <-call
$
listsMembers
(ListNameParam
thimura/haskell)
>>>
listsMembers (ListNameParam "thimura/haskell")
APIRequestGet "https://api.twitter.com/1.1/lists/members.json" [("slug","haskell"),("owner_screen_name","thimura")]>>>
listsMembers (ListIdParam 20849097)
APIRequestGet "https://api.twitter.com/1.1/lists/members.json" [("list_id","20849097")]
Saved Searches
Places & Geo
media
data MediaUpload Source
mediaUpload :: MediaData -> APIRequest MediaUpload UploadedMediaSource
Upload media and returns the media data.
You can update your status with multiple media by calling mediaUpload
and update
successively.
First, you should upload media with mediaUpload
:
res1 <-call
$
mediaUpload
(MediaFromFile
"/path/to/upload/file1.png") res2 <-call
$
mediaUpload
(MediaRequestBody
"file2.png" "[.. file body ..]")
and then collect the resulting media IDs and update your status by calling update
:
call
$
update
"Hello World"&
mediaIds
?~
[mediaId
res1,mediaId
res2]
See: https://dev.twitter.com/docs/api/multiple-media-extended-entities
>>>
mediaUpload (MediaFromFile "/home/test/test.png")
APIRequestPostMultipart "https://upload.twitter.com/1.1/media/upload.json" []