#!/usr/bin/php No rights reserved. Go crazy. */ // Add an entry here and symlink the script to the short-name, and you // can use this script for any site using MediaWiki. $urls = array('wiki'=>'http://en.wikipedia.org/', 'trek'=>'http://en.memory-alpha.org/', 'bol'=>'http://bol.wikia.com/', 'smallville'=>'http://smallville.wikia.com/'); $url = $urls[basename($argv[0])]; if (!$url) { $url = $urls['wiki']; } if ($argc>1) { $url .= 'wiki/Special:Search?go=1'; $qstring = urlencode(implode(' ',array_slice($argv,1))); if (($qstring)!='') { $url .= '&search='.$qstring; } } // open is a handy Mac command for opening anything (including URIs) // Gnome users can use gnome-open instead // on other platforms, try your browser directly exec("open ".escapeshellarg($url)); ?>