Reputation: 41
I have to integrate yahoo api in my app. Can anyone provide me with the steps for that?
As we have integrated yahoo we gets a tokenkey from yahoo and after entering the key we gets in to application.Does any one have process to directly entering in app after having the yahoo login.
Upvotes: 4
Views: 1983
Reputation: 12243
Here is a subset of code using the XML portion of Yahoo! Answers. I had written this to write my own answers 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);
The XML extraction is very crude, and if you would the best alternative is to use an XMLParser or XMLDocument as opposed to doing a String extrapolation. It's kinda ghetto
Upvotes: 1
Reputation: 1790
Try this Beginner Link :
http://developer.yahoo.com/social/sdk/objectivec/
Upvotes: 2