12 comments

[ 4.9 ms ] story [ 44.2 ms ] thread
This was a fun little project that started from a co-worker wanting to see random imgur files. I've just started playing with jQuery and JavaScript and this is the result so far.

Imgur uses 5 chars alphanumerical ids as the image names, and doesn't care if you use .jpg, .png, etc, etc. So I wrote a small backend that generates and spits out an array of keys to check. The JavaScript hides the image tag, and sets it, another function verifies that it's a real image (imgur sends 200s, and an image that tells you an image doesn't exist, so I check that the height and width match). If it does, then display the image, if not, try the next. When the array is about to run out, I fill it again. I also keep a small cache of the keys that it determined weren't valid (based on jQuery passing back to me the list of failed keys) to try to up the odds of getting an image quicker.

An unmini'ed version of the JavaScript is at http://image-roulette.com/static/js/image-roulette.js

Any feedback would be awesome =)

Are you just composing random strings and checking if an image exists at the URL?
The code composes random strings, and checks whether the returned image is the size of imgur's 404. So real images of that exact shape and size will also be skipped.
I got a sneak preview, so I'll just say what I've already said.

There needs to be a way to save interesting ones for other people to look through, vote on, and comment on. Here, for example, are some of the more interesting ones that I saw (some are NSFW, very much so, others are just nice, or funny, or weird):

http://i.imgur.com/yxmdh.jpg http://i.imgur.com/5XySW.jpg http://i.imgur.com/g1ZA3.jpg http://i.imgur.com/lxSBk.jpg http://i.imgur.com/3xUME.jpg http://i.imgur.com/4QrxH.jpg http://i.imgur.com/FmOHk.jpg http://i.imgur.com/5bGfT.jpg http://i.imgur.com/PJZDZ.jpg http://i.imgur.com/gy3c2.jpg http://i.imgur.com/XUGRv.jpg http://i.imgur.com/WFVny.jpg http://i.imgur.com/1LKtd.jpg http://i.imgur.com/kcuG9.jpg http://i.imgur.com/NpJ1r.jpg http://i.imgur.com/px1Wd.jpg http://i.imgur.com/w3xsD.jpg http://i.imgur.com/2Kftd.jpg http://i.imgur.com/XfkhI.jpg

Also it is on 4chan at http://boards.4chan.org/g/res/22241838 and you can just see people crying out for a way to keep track of the interesting ones.

Why would you post these links of NSFW images here?
Maybe to show what his results were? Ya, he maybe should have marked the individual images accordingly, but he say the images were NSFW.

Anyways, I clicked through to the site and was not provided witn a significant amount of NSFW images.

I was just giving a sample of the kinds of images that people might like to share and comment on.

Most weren't NSFW, the ones that were were not extreme, and I felt that the disclaimer was enough.

You should probably remove those NSFW ones. They don't add to the comment and could get someone fired since the NSFW warning is not prominent, and the images are not "girl in bikini" but full on nudes.
You are only able to edit a post for a limited time, and I'm long past the point of being able to edit that post.

As for the images, I kept a little file of interesting ones, and didn't want to go back and check them all to remember which were NSFW. So I simply put in the disclaimer and pasted.

That said, I felt that they did add to the comment. They give an idea of the variety of different things that could show up in a discussion, and indicate that you would need to separate them out by category.

The title of imgur posts are sometimes an important lead-in for the content, so you might want to include those.