开发者

Yahoo API Integration?

I have to integrate 开发者_如何学Goyahoo 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.


Try this Beginner Link :

http://developer.yahoo.com/social/sdk/objectivec/


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜