0
我正在開發一個在ios 5.1中運行的ipad應用程序,其中已完成twitter集成。現在,我可以使用twitter.framework使用我的應用程序發送推文。但是我想知道我們發佈的推文的細節。我用TWRequest的框架來發布查詢作爲使用Twitter框架獲取推文詳細信息
-(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。否則我需要以不同的方式進行查詢。請幫助我!