{"id":20,"date":"2008-10-11T00:23:28","date_gmt":"2008-10-11T04:23:28","guid":{"rendered":"http:\/\/adamrosenfield.com\/blog\/?p=20"},"modified":"2011-02-20T23:10:41","modified_gmt":"2011-02-21T03:10:41","slug":"slashdot-easter-egg","status":"publish","type":"post","link":"http:\/\/adamrosenfield.com\/blog\/2008\/10\/11\/slashdot-easter-egg\/","title":{"rendered":"Slashdot Easter Egg"},"content":{"rendered":"<p>Did you know that every time you view a page on <a href=\"http:\/\/slashdot.org\">slashdot<\/a>, you&#8217;re given a random Futurama quote?  Most people don&#8217;t, since they&#8217;re hidden away in the HTTP headers, so you&#8217;ll never see them via normal web browsing.  I discovered this one time when I was playing around with <a href=\"http:\/\/curl.haxx.se\/\">cURL<\/a>.  Here&#8217;s a sample HTTP trace:<\/p>\n<pre>adam-rosenfields-computer ~$ curl -I slashdot.org\r\nHTTP\/1.1 200 OK\r\nDate: Sat, 11 Oct 2008 04:16:23 GMT\r\nServer: Apache\/1.3.41 (Unix) mod_perl\/1.31-rc4\r\nSLASH_LOG_DATA: shtml\r\nX-Powered-By: Slash 2.005001224\r\nX-Bender: Boy, were we suckers!\r\nCache-Control: private\r\nPragma: private\r\nConnection: close\r\nContent-Type: text\/html; charset=iso-8859-1<\/pre>\n<p><code>-I<\/code> is the option for doing a HEAD request instead of a normal GET.  So, a quick and dirty script to generate a random Futurama quote is:<\/p>\n<pre>curl -I slashdot.org 2>\/dev\/null | grep '^X-' | grep -v '^X-Powered-By'<\/pre>\n<p>This works since all of the quotes are under a header name beginning with <code>X-<\/code>, e.g. <code>X-Bender<\/code>, <code>X-Fry<\/code>, or <code>X-Leela<\/code>.  I&#8217;m not sure how many total quotes there are in the database, but you could probably get a good estimate by sampling a large number of times and counting how many unique quotes and how many duplicates you get, and then extrapolating.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Did you know that every time you view a page on slashdot, you&#8217;re given a random Futurama quote? Most people don&#8217;t, since they&#8217;re hidden away in the HTTP headers, so you&#8217;ll never see them via normal web browsing. I discovered this one time when I was playing around with cURL. Here&#8217;s a sample HTTP trace: [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-20","post","type-post","status-publish","format-standard","hentry","category-misc"],"_links":{"self":[{"href":"http:\/\/adamrosenfield.com\/blog\/wp-json\/wp\/v2\/posts\/20","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/adamrosenfield.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/adamrosenfield.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/adamrosenfield.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/adamrosenfield.com\/blog\/wp-json\/wp\/v2\/comments?post=20"}],"version-history":[{"count":1,"href":"http:\/\/adamrosenfield.com\/blog\/wp-json\/wp\/v2\/posts\/20\/revisions"}],"predecessor-version":[{"id":185,"href":"http:\/\/adamrosenfield.com\/blog\/wp-json\/wp\/v2\/posts\/20\/revisions\/185"}],"wp:attachment":[{"href":"http:\/\/adamrosenfield.com\/blog\/wp-json\/wp\/v2\/media?parent=20"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/adamrosenfield.com\/blog\/wp-json\/wp\/v2\/categories?post=20"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/adamrosenfield.com\/blog\/wp-json\/wp\/v2\/tags?post=20"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}