Stupid PHP one liners: Google calc
A long time ago, I wrote a two line hack that let you use Google as a command line calculator. It eventually ended up in the 2nd and 3rd editions of Google Hacks.
I don’t know what caused by to look at that code again, but here’s the one line version:
print str_replace('<font size=-2> </font>', ',' , preg_replace('(.+<b>.+= (.+?)</b>.+)s', '$1', file_get_contents('http://www.google.com/search?q=' . urlencode(join(' ', array_splice($argv, 1)))))) . "\n";