View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Λόρδος Σπύρος Δεναξάς > URI-ParseSearchString > URI::ParseSearchString



Annotate this POD


New  4
Open  3
View/Report Bugs
Module Version: 0.1   Source   Latest Release: URI-ParseSearchString-3.51


URI::ParseSearchString - parse Apache refferer logs and extract search engine query strings.


Version 0.01


    use URI::ParseSearchString ( 'parse_search_string' );

    $string = parse_search_string('') ;



                This module provides a simple function to parse and extract search engine query strings. It was designed and tested having
                Apache referrer logs in mind. It can be used for a wide number of purposes, including tracking down what keywords people use
                on popular search engines before they land on a site. It makes use of URI::split to extract the string and URI::Escape to un-escape
                the encoded characters in it.   Although a number of existing modules and scripts exist for this purpose,
                the majority of them are either outdated using obsolete search strings associated with each engine.

                The default function exported is "parse_search_string" which accepts an unquoted referrer string as input and returns the 
                search engine query contained within. It currently works with both escaped and un-escaped queries and will translate the search
                terms before returning them in the latter case. The function returns undef in all other cases and errors.

                for example: 

                                $string = parse_search_string('') ;

                would return 'a simple test' 


                                $string = parse_search_string('') ;

                would return 'a more! complex_ search$' 

                Currently, the search engines supported include Yahoo, MSN, Google, Tiscali, Netscape, Blueyonder, Mamma, Hotbot, AllTheWeb,
                Lycos and Mirago. I would be glad to add support for any additional search engines you might come across so please feel free to email me.

                That is all, nothing fancy.


Spiros Denaxas, <s.denaxas at>


This is my first CPAN module so I encourage you to send all comments, especially bad, to my email address.


For more information, you could also visit my blog:



Copyright 2006 Spiros Denaxas, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: