(* COCANWIKI scripts. * Written by Richard W.M. Jones . * Copyright (C) 2004 Merjis Ltd. * $Id: search.ml,v 1.2 2004/09/07 13:40:10 rich Exp $ *) open Apache open Registry open Cgi open Cgi_escape open Printf open Cocanwiki let search : ('a -> 'b -> 'c, unit, string, string) format4 = "http://www.google.com/search?q=site:%s+%s" let run r (q : cgi) (dbh : Dbi.connection) (hostid, hostname, _) _ = let query = q#param "q" in let query = sprintf search (escape_url hostname) (escape_url query) in q#redirect query let () = register_script run