使用Twitter框架获取推文详细信息(Using Twitter framework to get tweet details)

编程入门 行业动态 更新时间:2024-10-17 23:23:03
使用Twitter框架获取推文详细信息(Using Twitter framework to get tweet details)

我正在开发一个在ios 5.1中运行的ipad应用程序,其中已完成twitter集成。 现在,我可以使用twitter.framework使用我的应用程序发推文。 但我想了解我们制作的推文的详细信息。 我在框架中使用TWRequest发布查询

-(IBAction)queryButtonTapped:(id)sender{ TWRequest *request = [[TWRequest alloc] initWithURL:[NSURL URLWithString:@"http://search.twitter.com/search.json?q=indians&rpp=5&with_twitter_user_id=true&result_type=recent"] parameters:nil requestMethod:TWRequestMethodGET]; [request performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) { if([urlResponse statusCode] >= 200){ NSError *error; NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:responseData options:0 error:&error]; UIAlertView *alertView1 = [[UIAlertView alloc] initWithTitle:@"Twitter response" message:[NSString stringWithFormat:@"response: %@",dict] delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alertView1 show]; } else{ UIAlertView *alertView2 = [[UIAlertView alloc] initWithTitle:@"oops" message:[NSString stringWithFormat:@"response: %i, and error is %@",[urlResponse statusCode],error] delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alertView2 show]; } }]; }

在这里,我正在搜索我做的印地安推文。

我收到一条消息,提示“Twitter REST API v1不再处于活动状态.PLease迁移到API v1.1。” 现在我想知道那个1.1版本是什么。 它是否与Twitter.framework有关,或者我应该获得新的twitter.framwork。 否则我需要以不同的方式查询。

I am developing an ipad application running in ios 5.1 in which twitter integration has been done. Now i could able to tweet using my application using the twitter.framework. But i want to get the details of the tweet that we made. I used TWRequest in the framework to post a query as

-(IBAction)queryButtonTapped:(id)sender{ TWRequest *request = [[TWRequest alloc] initWithURL:[NSURL URLWithString:@"http://search.twitter.com/search.json?q=indians&rpp=5&with_twitter_user_id=true&result_type=recent"] parameters:nil requestMethod:TWRequestMethodGET]; [request performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) { if([urlResponse statusCode] >= 200){ NSError *error; NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:responseData options:0 error:&error]; UIAlertView *alertView1 = [[UIAlertView alloc] initWithTitle:@"Twitter response" message:[NSString stringWithFormat:@"response: %@",dict] delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alertView1 show]; } else{ UIAlertView *alertView2 = [[UIAlertView alloc] initWithTitle:@"oops" message:[NSString stringWithFormat:@"response: %i, and error is %@",[urlResponse statusCode],error] delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alertView2 show]; } }]; }

Here i am searching indians tweet that i made.

I got an alert with message as "The Twitter REST API v1 is no longer active.PLease migrate to API v1.1." Now i want to know what is that 1.1 version. Does it have something to do with Twitter.framework or should i get new twitter.framwork. Or else i need to query in different manner.

最满意答案

我一个月来一直有同样的问题,看看这是否有帮助。 twitter框架使用api 1.0版本,现在已经取消了。

I have been having the same issue for a month now, see if this helps. The twitter framework uses api version 1.0 and its has been take down now.

更多推荐

本文发布于:2023-08-03 19:05:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1398165.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:详细信息   框架   Twitter   details   tweet

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!