This URL takes you to an image, but has no file extension to check a regex against:
http://www.tonymooreillustration.com/gallery/main.php?g2_view=core.DownloadItem&g2_itemId=393
I'm using Restclient (HTTP and REST client for Ruby) in my app, so I tried doing this:
RestClient.get "http://www.tonymooreillustration.com/gallery/main.php?g2_view=core.DownloadItem&g2_itemId=393"
I get back lots of text that begins like this:
"\377???JFIF\000\001\002\001\000H\000H\000\000\377?cExif\000\000MM\000*\000\000\000\b\000\a\001\022\000\003\000\000\000\001\000\001\000\000\001\032\000\005\000\000\000\001\000\000\000b\001\e\000\005\000\000\000\001\000\000\000j\001(\000\003\000\000\000\001\000\002\000\000\0011\000\002\000\000\000\024\000\000\000r\0012\000\002\000\000\000\024\000\000\000\206\207i\000\004\000\000\000\001\000\000\000\234\000\000\000?\000\000H\000\000\000\001\000\000\000H\000\000\000\001Adobe Photoshop 7.0\0002005:07:12 02:58:19\000\000\000\000\003\240\001\000\003\000\000\000\001\377\377\000\000\240\002\000\004\000\000\000\001\000\000\001?\000\004\000\000\000\001\000\000\002?\000\000\000\000\000\006\001\003\000\003\000\000\000
Is there a way I can use this to determine if the URL is pointing at an image?