MGTwitterEngine:获取批量用户信息:
我正在使用 MGTwitterEngine 从 NSString 中获取配置文件,但我只得到列表中的第一个响应。更改 MGTwitterEngine.m 中的方法以使用 screen_name 而不是 user_id 会出现 404 错误,使用 user_id 可以,但它只返回列表中的第一个。
NSString *path = [NSString stringWithFormat:@"users/lookup.%@?screen_name=%@", API_FORMAT, userIDs];
MGTwitterEngine.m
- (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];}
enter code here
我的方法:
- (void)userInfoReceived:(NSArray *)userInfo forRequest:(NSString *)connectionIdentifier {
for(NSDictionary *d in userInfo) {
NSLog(@"dee: %@", d);}
.. 和我的电话:
[_engine getBulkUserInformationFor:@"14483463,25552002,1540791,307428962,61605222"];
I'm using MGTwitterEngine to grab profiles from an NSString but I only get the first response in the list. Changing the method in MGTwitterEngine.m to use screen_name instead of user_id gives me a 404 error, using user_id works, but it only returns the first in the list.
NSString *path = [NSString stringWithFormat:@"users/lookup.%@?screen_name=%@", API_FORMAT, userIDs];
MGTwitterEngine.m
- (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];}
enter code here
My method:
- (void)userInfoReceived:(NSArray *)userInfo forRequest:(NSString *)connectionIdentifier {
for(NSDictionary *d in userInfo) {
NSLog(@"dee: %@", d);}
.. and my call:
[_engine getBulkUserInformationFor:@"14483463,25552002,1540791,307428962,61605222"];
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来与 mgtwitterengine 的 github 页面上的此问题类似:
https://github.com/ mattgemmell/MGTwitterEngine/issues/58
更改
为
MGTwitterEngine.m
sounds like a similiar problem to this issue on the github page for mgtwitterengine:
https://github.com/mattgemmell/MGTwitterEngine/issues/58
change
to
in MGTwitterEngine.m