Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

support getting bulk information about users by id. Used to look up f…

…riends by their ids
  • Loading branch information...
commit 7be30a3f5f00d9a83e60d94d47931c1c7322d2bc 1 parent c606630
@magicseth magicseth authored
Showing with 17 additions and 0 deletions.
  1. +2 −0  MGTwitterEngine.h
  2. +14 −0 MGTwitterEngine.m
  3. +1 −0  MGTwitterRequestTypes.h
View
2  MGTwitterEngine.h
@@ -119,6 +119,8 @@
- (NSString *)getFollowersIncludingCurrentStatus:(BOOL)flag; // statuses/followers
- (NSString *)getUserInformationFor:(NSString *)usernameOrID; // users/show
+- (NSString *)getBulkUserInformationFor:(NSString *)userIDs;
+
- (NSString *)getUserInformationForEmail:(NSString *)email; // users/show
View
14 MGTwitterEngine.m
@@ -1290,6 +1290,20 @@ - (NSString *)getUserInformationFor:(NSString *)usernameOrID
responseType:MGTwitterUser];
}
+- (NSString *)getBulkUserInformationFor:(NSString *)userIDs
+{
+ if (!userIDs) {
+ return nil;
+ }
+ NSString *path = [NSString stringWithFormat:@"users/lookup.%@?user_id=%@", API_FORMAT, userIDs];
+ NSMutableDictionary *params = [NSMutableDictionary dictionaryWithCapacity:0];
+
+
+ return [self _sendRequestWithMethod:nil path:path queryParameters:params body:nil
+ requestType:MGTwitterBulkUserInformationRequest
+ responseType:MGTwitterUsers];
+}
+
- (NSString *)getUserInformationForEmail:(NSString *)email
{
View
1  MGTwitterRequestTypes.h
@@ -22,6 +22,7 @@ typedef enum _MGTwitterRequestType {
MGTwitterFriendUpdatesForUserRequest, // last status for the people that the specified user follows
MGTwitterFollowerUpdatesRequest, // last status for the people that follow the current user
MGTwitterUserInformationRequest, // user information using the specified id or email
+ MGTwitterBulkUserInformationRequest, // user information using the specified id or email
MGTwitterDirectMessagesRequest, // latest direct messages to the current user
MGTwitterDirectMessagesSentRequest, // latest direct messages from the current user
MGTwitterDirectMessageSendRequest, // send a new direct message from the current user
Please sign in to comment.
Something went wrong with that request. Please try again.