Showing posts with label random. Show all posts
Showing posts with label random. Show all posts

Saturday, March 22, 2008

Futurama fans: Listen up

There's a nifty unix command you can enter to get random futurama quotes:
curl -Is slashdot.org | egrep '^X-(F|B)' | cut -d \- -f 2

Okay, so how does it work? Let's look at what curl -Is slashdot.org returns:

HTTP/1.1 200 OK
Date: Sun, 23 Mar 2008 01:04:28 GMT
Server: Apache/1.3.37 (Unix) mod_perl/1.29
SLASH_LOG_DATA: shtml
X-Powered-By: Slash 2.005000198
X-Leela: I'm a millionaire! Suddenly I have an opinion about the capital gains tax.
Cache-Control: private
Pragma: private
Vary: User-Agent,Accept-Encoding
Connection: close
Content-Type: text/html; charset=iso-8859-1

Pretty neat eh?
Now, what it does is it looks for lines that start with "X-" and contain F or B after the "X-"; thus bringing up Fry or Bender quotes only :).