首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >IOS获取Twitter当前的顶级趋势

问IOS获取Twitter当前的顶级趋势
EN

Stack Overflow用户
提问于 2014-05-23 20:20:23
回答 1查看 216关注 0票数 1

我想了解Twitter当前的趋势。我厌倦了https://dev.twitter.com/docs/api/get-trendscurrent,但是没有数据。我的密码在这里:

代码语言:javascript
复制
-(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"];
            }
        });
    }];
}

我的错是什么。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-05-23 22:17:39

API版本1被逐步淘汰。在这里尝试1.1版本:https://dev.twitter.com/docs/api/1.1/overview

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23837779

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档