WWW::Search::AltaVista::AdvancedWeb3pm
Class for advanced alta vista web searching
Usage
use WWW::Search;my $search = new WWW::Search('AltaVista::AdvancedWeb');$search->native_query(WWW::Search::escape_query('(bmw AND mercedes) AND NOT (used OR Ferrari)'));$search->maximum_to_retrieve('100');while (my $result = $search->next_result()){print $result->url, "\n";}
Overview
Class hack for Advance AltaVista web search mode originally written by John Heidemann http://www.altavista.com.
This hack now allows for AltaVista AdvanceWeb search results to be sorted and relevant results returned first. Initially, this class had skipped the 'r' option which is used by AltaVista to sort search results for relevancy. Sending advance query using the 'q' option resulted in random returned search results which made it impossible to view best scored results first.
This class exports no public interface; all interaction should be done through WWW::Search objects.
Help
Use AND to join two terms that must both be present for a document to count as a match.
Use OR to join two terms if either one counts.
Use AND NOT to join two terms if the first must be present and the second must NOT.
Use NEAR to join two terms if they both must appear and be within 10 words of each other.
Try this example:
cars AND bmw AND mercedes
You don't have to capitalize the "operators" AND, OR, AND NOT, or NEAR. But many people do to make it clear what is a query term and what is an instruction to the search engine.
One other wrinkle that's very handy: you can group steps together with parentheses to tell the system what order you want it to perform operations in.
(bmw AND mercedes) NEAR cars AND NOT (used OR Ferrari)
Keep in mind that grouping should be used as much as possible because if you attempt to enter a long query using AND to join the words you may not receive any results because the entire query would be like one long phrase. For best reuslts follow the example herein.
Version history
2.07 - unescape URLs, and bugfix for undefined $hit
2.06 - do not use URI::URL
2.02 - Added HELP POD. Misc. Clean-up for latest changes.
2.01 - Additional query modifiers added for even better results.
2.0 - Minor change to set lowercase Boolean operators to uppercase.
1.9 - First hack version release.
native_setup_search
This private method does the heavy lifting after native_query() is called.
Releases
13 releases since Debian 1.3 (Bo); the text changed 8 times.