Skip to content

Instantly share code, notes, and snippets.

@ykzts
Created May 6, 2010 21:09
Show Gist options
  • Save ykzts/392708 to your computer and use it in GitHub Desktop.
Save ykzts/392708 to your computer and use it in GitHub Desktop.
--- Classes/Views/Log/ImageURLParser.m.orig 2010-05-07 03:46:46.000000000 +0900
+++ Classes/Views/Log/ImageURLParser.m 2010-05-07 06:08:33.000000000 +0900
@@ -80,6 +80,14 @@
}
}
}
+ else if ([host hasSuffix:@"tumblr.com"]) {
+ NSArray* ary1 = [host componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"."]];
+ NSArray* ary2 = [path componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"/"]];
+ NSString* userId = [ary1 objectAtIndex:0];
+ NSString* photoId = [ary2 objectAtIndex:2];
+
+ return [NSString stringWithFormat:@"http://api.desire.sh/tumblr-photo/%@/%@", userId, photoId];
+ }
return nil;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment