我想了解Twitter当前的趋势。我厌倦了https://dev.twitter.com/docs/api/get-trendscurrent,但是没有数据。我的密码在这里:
-(void) getTwitterTopTrends{
// 1. Create a variable for twitter
NSURL *feedURL = [NSURL URLWithString:@"http://api.twitter.com/1/trends/current.json"];
// 2. Create TWRequest, with parameters, URL & specify GET method
SLRequest *twitterFeed = [SLRequest requestForServiceType:SLServiceTypeTwitter requestMethod:SLRequestMethodGET URL:feedURL parameters:nil];
twitterFeed.account = _twitterAccount;
// Making the request
[twitterFeed performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) {
dispatch_async(dispatch_get_main_queue(), ^{
// Check if we reached the reate limit
if (responseData) {
NSError *error = nil;
NSDictionary *TWData = [NSJSONSerialization JSONObjectWithData:responseData options:NSJSONReadingMutableLeaves error:&error];
NSArray* results = TWData [@"trends"];
}
});
}];
}我的错是什么。
发布于 2014-05-23 22:17:39
API版本1被逐步淘汰。在这里尝试1.1版本:https://dev.twitter.com/docs/api/1.1/overview
https://stackoverflow.com/questions/23837779
复制相似问题