home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2000 May
/
Chip_2000-05_cd1.bin
/
zkuste
/
Perl
/
ActivePerl-5.6.0.613.msi
/
䆊䌷䈹䈙䏵-䞅䞆䞀㡆䞃䄦䠥
/
_9ff40e953f9e46cd3fbdbd0330397314
< prev
next >
Wrap
Text File
|
2000-03-23
|
6KB
|
151 lines
<HTML>
<HEAD>
<TITLE>WWW::Search::Google - class for searching Google</TITLE>
<LINK REL="stylesheet" HREF="../../../../Active.css" TYPE="text/css">
<LINK REV="made" HREF="mailto:">
</HEAD>
<BODY>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
<TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
<STRONG><P CLASS=block> WWW::Search::Google - class for searching Google</P></STRONG>
</TD></TR>
</TABLE>
<A NAME="__index__"></A>
<!-- INDEX BEGIN -->
<UL>
<LI><A HREF="#name">NAME</A></LI><LI><A HREF="#supportedplatforms">SUPPORTED PLATFORMS</A></LI>
<LI><A HREF="#synopsis">SYNOPSIS</A></LI>
<LI><A HREF="#description">DESCRIPTION</A></LI>
<LI><A HREF="#linux search">LINUX SEARCH</A></LI>
<LI><A HREF="#see also">SEE ALSO</A></LI>
<LI><A HREF="#how does it work">HOW DOES IT WORK?</A></LI>
<LI><A HREF="#testing">TESTING</A></LI>
<LI><A HREF="#author">AUTHOR</A></LI>
<LI><A HREF="#bugs">BUGS</A></LI>
<LI><A HREF="#version history">VERSION HISTORY</A></LI>
<LI><A HREF="#legalese">LEGALESE</A></LI>
</UL>
<!-- INDEX END -->
<HR>
<P>
<H1><A NAME="name">NAME</A></H1>
<P>WWW::Search::Google - class for searching Google</P>
<P>
<HR>
<H1><A NAME="supportedplatforms">SUPPORTED PLATFORMS</A></H1>
<UL>
<LI>Linux</LI>
<LI>Solaris</LI>
<LI>Windows</LI>
</UL>
<HR>
<H1><A NAME="synopsis">SYNOPSIS</A></H1>
<P>use WWW::Search;
my $Search = new WWW::Search('Google'); # cAsE matters
my $Query = WWW::Search::escape_query(``Where is Jimbo'');
$Search->native_query($Query);
while (my $Result = $Search-><CODE>next_result())</CODE> {
print $Result->url, ``\n'';
}</P>
<P>
<HR>
<H1><A NAME="description">DESCRIPTION</A></H1>
<P>This class is a Google specialization of WWW::Search.
It handles making and interpreting Google searches.
<EM><A HREF="http://www.google.com">http://www.google.com</A></EM>.</P>
<P>Googles returns 100 Hits per page. Custom Linux Only search capable.</P>
<P>This class exports no public interface; all interaction should
be done through <A HREF="../../../../site/lib/WWW/Search.html">the WWW::Search manpage</A> objects.</P>
<P>
<HR>
<H1><A NAME="linux search">LINUX SEARCH</A></H1>
<P>For LINUX lovers like me, you can put Googles in a LINUX only search
mode by changing search URL from:</P>
<PRE>
'search_url' => '<A HREF="http://www.google.com/search">http://www.google.com/search</A>',</PRE>
<P>to:</P>
<PRE>
'search_url' => '<A HREF="http://www.google.com/linux">http://www.google.com/linux</A>',</PRE>
<P>
<HR>
<H1><A NAME="see also">SEE ALSO</A></H1>
<P>To make new back-ends, see <A HREF="../../../../site/lib/WWW/Search.html">the WWW::Search manpage</A>.</P>
<P>
<HR>
<H1><A NAME="how does it work">HOW DOES IT WORK?</A></H1>
<P><CODE>native_setup_search</CODE> is called (from <CODE>WWW::Search::setup_search</CODE>)
before we do anything. It initializes our private variables (which
all begin with underscore) and sets up a URL to the first results
page in <CODE>{_next_url}</CODE>.</P>
<P><CODE>native_retrieve_some</CODE> is called (from <CODE>WWW::Search::retrieve_some</CODE>)
whenever more hits are needed. It calls <CODE>WWW::Search::http_request</CODE>
to fetch the page specified by <CODE>{_next_url}</CODE>.
It then parses this page, appending any search hits it finds to
<CODE>{cache}</CODE>. If it finds a ``next'' button in the text,
it sets <CODE>{_next_url}</CODE> to point to the page for the next
set of results, otherwise it sets it to undef to indicate we''re done.</P>
<P>
<HR>
<H1><A NAME="testing">TESTING</A></H1>
<P>This module adheres to the <CODE>WWW::Search</CODE> test suite mechanism.</P>
<P>
<HR>
<H1><A NAME="author">AUTHOR</A></H1>
<P>This backend is written and maintained/supported by Jim Smyser.
<<A HREF="mailto:jsmyser@bigfoot.com">jsmyser@bigfoot.com</A>></P>
<P>
<HR>
<H1><A NAME="bugs">BUGS</A></H1>
<P>Google is not an easy search engine to parse in that it is capable
of altering it's output ever so slightly on different search terms.
There may be new slight results output the author has not yet seen that
will pop at any given time for certain searches. So, if you think you see
a bug keep the above in mind and send me the search words you used so I
may code for any new variations.</P>
<P>
<HR>
<H1><A NAME="version history">VERSION HISTORY</A></H1>
<P>2.13
New regexp to parse newly found results format with certain search terms.</P>
<P>2.10
removed warning on absence of description; new test case</P>
<P>2.09
Google NOW returning url and title on one line.</P>
<P>2.07
Added a new parsing routine for yet another found result line.
Added a substitute for whacky url links some queries can produce.
Added Kingpin's new <CODE>hash_to_cgi_string()</CODE> 10/12/99</P>
<P>2.06
Fixed missing links / regexp crap.</P>
<P>2.05
Matching overhaul to get the code parsing right due to multiple
tags being used by google on the hit lines. 9/25/99</P>
<P>2.02
Last Minute description changes 7/13/99</P>
<P>2.01
New test mechanism 7/13/99</P>
<P>1.00
First release 7/11/99</P>
<P>
<HR>
<H1><A NAME="legalese">LEGALESE</A></H1>
<P>THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.</P>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
<TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
<STRONG><P CLASS=block> WWW::Search::Google - class for searching Google</P></STRONG>
</TD></TR>
</TABLE>
</BODY>
</HTML>