diff --git a/lib/Leto/Util/Web.pm b/perl_lib/Leto/Util/Web.pm similarity index 83% rename from lib/Leto/Util/Web.pm rename to perl_lib/Leto/Util/Web.pm index 7fcd02e..ec3334a 100644 --- a/lib/Leto/Util/Web.pm +++ b/perl_lib/Leto/Util/Web.pm @@ -9,11 +9,11 @@ our @EXPORT = qw//; sub is_search_request($) { my $r = shift; - my @engines = qw{ - /search\? + my @engines = qw{ + /search\? images\.google search\.yahoo\.com - msn\.com + msn\.com live\.com del\.icio\.us/search }; diff --git a/lib/t/Web.t b/perl_lib/t/Web.t similarity index 100% rename from lib/t/Web.t rename to perl_lib/t/Web.t diff --git a/php_lib/web_util.php b/php_lib/web_util.php new file mode 100644 index 0000000..2737c3c --- /dev/null +++ b/php_lib/web_util.php @@ -0,0 +1,15 @@ +function is_search_request() { + $r = $_SERVER['HTTP_REFERER']; + $engines = array('/search?', + 'images.google.', + 'search.yahoo.com', + 'del.icio.us/search', + 'msn.com', + 'live.com', + ); + foreach ($engine as $eng) { + if (strpos($r,$eng) !== false) + return true; + } + return false; +}