Created
May 24, 2011 08:36
-
-
Save aaronpearce/988345 to your computer and use it in GitHub Desktop.
Fuckyou.
This file contains hidden or 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
-(NSString *)avatarCreate:(NSString *)username:(NSInteger)num { | |
NSArray *extensions = [NSArray arrayWithObjects:@".gif", @".gif", @".jpg", @".png", nil]; | |
NSLog(@"%@", num); | |
num &= 3; | |
NSLog(@"%@", num); | |
NSString *extension = [extensions objectAtIndex:num]; | |
if([extension isEqualToString:@""]) { | |
extension = @".gif"; | |
} | |
NSString *userurl; | |
if (!num) { | |
userurl = [NSString stringWithFormat:@"http://a.deviantart.com/avatars/%@/%@/%@%@", [username substringWithRange:NSMakeRange(0, 1)], [username substringWithRange:NSMakeRange(1, 1)], username, extension]; | |
userurl = [userurl lowercaseString]; | |
} else { | |
userurl = [NSString stringWithFormat:@"http://a.deviantart.com/avatars/default.gif"]; | |
} | |
NSLog(@"%@", [NSString stringWithFormat:@"<img src='%@' title='%@' />", userurl, username]); | |
return [NSString stringWithFormat:@"<img src='%@' title='%@' />", userurl, username]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment