NSString
*url = @"http://www.example.com";
NSString
*apiUrl = [NSString
stringWithFormat:@"http://api.tr.im/v1/trim_simple?url=%@",url];
NSString
*shortURL = [NSString
stringWithContentsOfURL:[NSURL
URLWithString:apiUrl]
encoding:NSASCIIStringEncoding
error:nil];
NSLog(@"Long:
%@ = Short: %@",url,shortURL);
No comments:
Post a Comment