Playlist Generator  1.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Defines
Playlist2/AnalysisConnection.mm
Go to the documentation of this file.
00001 //
00002 //  AnalysisConnection.m
00003 //  Playlist2
00004 //
00005 //  Created by Max Woolf on 26/11/2011.
00006 //  Copyright (c) 2011 __MyCompanyName__. All rights reserved.
00007 //
00008 
00009 #import "AnalysisConnection.h"
00010 #define API_KEY "BNOAEBT3IZYZI6WXI"
00011 
00012 @implementation AnalysisConnection
00013 -(id)initWithRequest:(NSURLRequest *)request delegate:(id)delegate echoprintCode:(NSString *)echoprintCode
00014 {
00015     code = echoprintCode;
00016     self = [super initWithRequest:[self getRequest] delegate:delegate];
00017     return self;
00018 }
00019 
00020 -(NSURLRequest *)getRequest
00021 {
00022     NSString *queryString = [[NSString alloc]initWithFormat:@"http://developer.echonest.com/api/v4/song/identify?api_key=%s&version=4.11&code=%@", API_KEY, code];
00023     NSLog(@"%@", queryString);
00024     NSURL *queryURL = [[NSURL alloc] initWithString:queryString];
00025     NSURLRequest *request = [[NSURLRequest alloc] initWithURL:queryURL];
00026     return request;
00027 }
00028 @end