Skip to content

Instantly share code, notes, and snippets.

@febuiles
Created October 7, 2008 06:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save febuiles/15245 to your computer and use it in GitHub Desktop.
Save febuiles/15245 to your computer and use it in GitHub Desktop.
undefined
#include <stdio.h>
#import <Cocoa/Cocoa.h>
int main() {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSURL *url = [NSURL URLWithString:@"http://lyricwiki.org/api.php?func=getSong&artist=Protest_the_Hero&song=Bloodmeat&fmt=xml"];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
NSURLResponse *response;
NSError *error;
NSData *data;
data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
NSLog(@"%s", [data bytes]);
return 0;
}
// gcc -framework Cocoa -o protest foo.m && ./protest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment