I've searched up and down for a solution, but each one I found do not work and Yahoo's BOSS documentation is awful. It shows you how to send a request to the API but it clearly lacks all of the other required parameters that need to be included to fulfill OAuth.
My app is a search app. I'm using a TableViewController and UISearchBar to populate the table with web search results.
My table cells work fine and the table populates with fake results.
[Image unavailable because I need 10 reputation points... wow.]
However, BOSS integration is proving to be a headache and I'm unfamiliar with this type of web programming.
- (void)filterContentForSearchText:(NSString*)searchText scope:(NSString*)scope
{
NSString *appid = @"{CONSUMER_KEY}"; // Provided by Yahoo
NSString *query = searchText;
NSString *address = @"http://ift.tt/1EJhCU1";
NSString *request = [NSString stringWithFormat:@"%@%@%@%@%@",address, query, @"?appid=", appid, @"&format=xml"];
// TEST URL: http://ift.tt/18gyXZC
NSURL *URL = [NSURL URLWithString:request];
NSError *error;
NSString *XML = [NSString stringWithContentsOfURL:URL encoding:NSASCIIStringEncoding error:&error];
NSLog(@"%@", error);
{CONSUMER_KEY} is the long special key provided by Yahoo upon registering your app to use their service.
I was receiving all kinds of oauth errors but documentation online says that BOSS doesn't use OAuth.
If anyone knows how to set me in the right direction, that'd be fantastic. Thank you!
Aucun commentaire:
Enregistrer un commentaire