Yahoo API Integration?

天涯浪子 提交于 2019-11-29 22:26:09

问题


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.


回答1:


Try this Beginner Link :

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




回答2:


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



来源:https://stackoverflow.com/questions/7361290/yahoo-api-integration

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!