-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathIRWebAPITwitterInterface+User.m
More file actions
43 lines (26 loc) · 1.59 KB
/
IRWebAPITwitterInterface+User.m
File metadata and controls
43 lines (26 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//
// IRWebAPITwitterInterface+User.m
// IRWebAPIKit
//
// Created by Evadne Wu on 4/5/11.
// Copyright 2011 Iridia Productions. All rights reserved.
//
#import "IRWebAPITwitterInterface+User.h"
@implementation IRWebAPITwitterInterface (User)
- (void) retrieveMetadataForUserWithIdentifiers:(NSArray *)identifiers withSuccessHandler:(IRWebAPIInterfaceCallback)inSuccessCallback failureHandler:(IRWebAPIInterfaceCallback)inFailureCallback {
[self.engine fireAPIRequestNamed:@"1/users/lookup.json" withArguments:[NSDictionary dictionaryWithObjectsAndKeys:
[identifiers componentsJoinedByString:@","], @"user_id",
[NSNumber numberWithBool:YES], @"include_entities",
nil] options:nil validator:[self defaultNoErrorValidator] successHandler: ^ (NSDictionary *inResponseOrNil, NSDictionary *inResponseContext, BOOL *outNotifyDelegate, BOOL *outShouldRetry) {
if (inSuccessCallback)
inSuccessCallback(inResponseOrNil, outNotifyDelegate, outShouldRetry);
} failureHandler: ^ (NSDictionary *inResponseOrNil, NSDictionary *inResponseContext, BOOL *outNotifyDelegate, BOOL *outShouldRetry) {
if (inFailureCallback)
inFailureCallback(inResponseOrNil, outNotifyDelegate, outShouldRetry);
}];
}
- (void) retrieveMetadataForUser:(IRWebAPITwitterUserID)anUserID withSuccessHandler:(IRWebAPIInterfaceCallback)successBlock failureHandler:(IRWebAPIInterfaceCallback)failureBlock {
// Just a convenience!
return [self retrieveMetadataForUserWithIdentifiers:[NSArray arrayWithObject:[NSNumber numberWithUnsignedLongLong:anUserID]] withSuccessHandler:successBlock failureHandler:failureBlock];
}
@end