Created
July 24, 2011 08:15
-
-
Save aaronpearce/1102400 to your computer and use it in GitHub Desktop.
Yup
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
// avatar maker | |
-(NSString *)avatarCreate:(NSString *)userName:(int)num { | |
NSArray *extensions = [NSArray arrayWithObjects:@".gif", @".gif", @".jpg", @".png", nil]; | |
int x = 3; | |
// fuck this shit :iconfuckthisshitplz: | |
int tnum = num & x; | |
NSString *extension = [extensions objectAtIndex:tnum]; | |
[extension retain]; | |
if([extension isEqualToString:@""]) { | |
extension = @".gif"; | |
} | |
NSString *userurl; | |
if (tnum) { | |
userurl = [NSString stringWithFormat:@"http://a.deviantart.com/avatars/%@/%@/%@%@", [userName substringWithRange:NSMakeRange(0, 1)], [userName substringWithRange:NSMakeRange(1, 1)], userName, extension]; | |
userurl = [userurl lowercaseString]; | |
NSLog(@"%@", userurl); | |
} else { | |
userurl = [NSString stringWithFormat:@"http://a.deviantart.com/avatars/default.gif"]; | |
} | |
[extension release]; | |
return [NSString stringWithFormat:@"<a href='http://%@.deviantart.com/' class='img-link'><img src='%@' title='%@' /></a>", userName, userurl, userName]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment