Magic 8ttp Ball

Posted by Jamis on March 07, 2008 @ 01:07 PM

My son, Britton, woke up this morning a little before 4am. As I was getting back into bed after feeding him, I saw that the clock read “4:04”, and (being the geek I am) I immediately thought “heh, 404 Sleep Not Found”.

He woke up a few minutes later, needing a bit of comforting (he’s definitely not usually this needy!), and when I got back into bed, the clock read “4:22”, obviously telling me that sleep was an “Unprocessable Entity”.

And thus the Magic 8ttp Ball was born.

Go on! Ask it anything! It’ll give you a suitably ambiguous HTTP response code in return. I’ve even been told it works great on the iPhone for when you have those burning questions on-the-go.

Posted in Announcements

Comments

Have something to add? Click here to leave a comment.

07 Mar 2008

1. Daniel said...

Amazing. Fantastic Job

2. Tim Harper said...

You’ve impacted me for life. I will never look at a clock the same. Ever. :)

3. Eric Anderson said...

Enjoyed this greatly. Especially the fact that the styling of the answer looks like a browser response.

4. Nicolás Sanguinetti said...

Damn, it’s 9:40, now I have to wait for about 4 hours before the hour becomes useful.

5. andy said...

as someone else with a baby boy waking me up a few times a night I found this to be especially heart-warming

thanks

6. Keeto said...

One of the funniest things I’ve seen in a long time.. Great work..

08 Mar 2008

7. kylichuku said...

hehe, using brute force technique you can get really appropriate answers to the questions :)

8. hatless said...

I’m disappointed that the actual status code being returned for all of them is good ol’ 200. How are we supposed to implement applications that consume it in an efficient way if we have to scrape the body text?

9. Jamis said...

@hatless, I tried having it actually return that status code, but some of them are actually interpreted by the browser as that status, with unexpected consequences. Imagine that! A browser understanding a status code! ;)

On the other hand, though, you obviously didn’t think to try the XML version:

1
curl -i "http://8ttp.jamisbuck.org/answer.xml?q=Will Java ever make a comeback"

That will return a blank body with the “correct” HTTP status code, and an X-Question header that echoes the original question.

10. Jamis said...

sigh

Never mind. The XML version doesn’t actually work, because lighttpd translates HTTP status codes it doesn’t understand (which is most of them) to “400 Bad Request”.

Ah, well.

11. hatless said...

Must say I’m impressed that you at least intended to have it work “properly”. :)

11 Mar 2008

12. JohnB said...

As usual, I am in awe. I trust that the https version works for when I need a secure answer to “she loves me, or loves me not?”...

15 Mar 2008

13. Ryan said...

Goodbye the rest of the afternoon!

08 Apr 2008

14. Dustin said...

Jamis,

Aren’t you the original developer of Vade Mecum? You’ve come a long way! :D

404 Sleep not found! Awesome. Glad to see family life gets others up at 4:00 am to (hopefully) get something done.

10 Apr 2008

15. Jamis said...

@Dustin, yes, I originally wrote Vade Mecum, too! I’ve dabbled in quite a few different things, and PocketPC development was one of them. :)