Yahoo API Integration?

I need to integrate yahoo api in my application. Can someone provide me steps for this?

As we integrated yahoo, we get a token from yahoo and after entering the key that we get into the application. Anyone has the opportunity to directly enter the application after logging in to yahoo.

+4
source share
2 answers

Here is a subset of the code using the Yahoo! XML part Answers I wrote this to write my own answer app.

NSString *question = @"Who won the 1975 World Series?"; NSString *address = @"http://answers.yahooapis.com/AnswersService/V1/questionSearch?appid=iQuestion&query="; NSString *request = [NSString stringWithFormat:@"%@%@",address,question]; NSURL *URL = [NSURL URLWithString:request]; NSError *error; NSString *XML = [NSString stringWithContentsOfURL:URL encoding:NSASCIIStringEncoding error:&error]; // Extract current answer the 'dirty' way NSString *answer = [[[[XML componentsSeparatedByString:@"<ChosenAnswer>"] objectAtIndex:1] componentsSeparatedByString:@"</ChosenAnswer>"] objectAtIndex:0]; NSLog(@"%@", answer); 

Extraction of XML is very rude, and if you would be better off using XMLParser or XMLDocument as opposed to doing String extrapolation. It's a kind of ghetto

+1
source

All Articles