Created
October 7, 2008 06:02
-
-
Save febuiles/15245 to your computer and use it in GitHub Desktop.
undefined
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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