home *** CD-ROM | disk | FTP | other *** search
-
- <HTML>
- <HEAD>
- <TITLE>WWW::SearchResult - class for results returned from WWW::Search</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::SearchResult - class for results returned from WWW::Search</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="#see also">SEE ALSO</A></LI>
- <LI><A HREF="#required results">REQUIRED RESULTS</A></LI>
- <LI><A HREF="#methods and functions">METHODS AND FUNCTIONS</A></LI>
- <UL>
-
- <LI><A HREF="#new">new</A></LI>
- <LI><A HREF="#url">url</A></LI>
- <LI><A HREF="#urls">urls</A></LI>
- <LI><A HREF="#add_url">add_url</A></LI>
- <LI><A HREF="#related_urls, add_related_url, related_titles, add_related_title">related_urls, add_related_url, related_titles, add_related_title</A></LI>
- <LI><A HREF="#title, description, score, change_date, index_date, size, raw">title, description, score, change_date, index_date, size, raw</A></LI>
- <LI><A HREF="#company, location, source">company, location, source</A></LI>
- </UL>
-
- </UL>
- <!-- INDEX END -->
-
- <HR>
- <P>
- <H1><A NAME="name">NAME</A></H1>
- <P>WWW::SearchResult - class for results returned from WWW::Search</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>
- <PRE>
- require WWW::Search;
- require WWW::SearchResult;
- $search = new WWW::Search;
- $search->native_query(WWW::Search::escape_query($query));
- # get first result
- $result = $search->next_result();</PRE>
- <P>
- <HR>
- <H1><A NAME="description">DESCRIPTION</A></H1>
- <P>A framework for returning the results of <CODE>WWW::Search</CODE>.</P>
- <P>
- <HR>
- <H1><A NAME="see also">SEE ALSO</A></H1>
- <P><A HREF="../../../site/lib/WWW/Search.html">the WWW::Search manpage</A></P>
- <P>
- <HR>
- <H1><A NAME="required results">REQUIRED RESULTS</A></H1>
- <P>The particular fields returned in a result are backend- (search
- engine-) dependent. However, all search engines are required to
- return a url and title. (This list may grow in the future.)</P>
- <P>
- <HR>
- <H1><A NAME="methods and functions">METHODS AND FUNCTIONS</A></H1>
- <P>
- <H2><A NAME="new">new</A></H2>
- <P>To create a new WWW::SearchResult, call</P>
- <PRE>
- $result = new WWW::SearchResult();</PRE>
- <P>
- <H2><A NAME="url">url</A></H2>
- <P>Returns the primary URL. Note that there may be a list of urls, see
- also methods <CODE>urls</CODE> and <CODE>add_url</CODE>. Nothing special is guaranteed
- about the primary URL other than that it is the first one returned by
- the back end.</P>
- <P>Every result is required to have at least one URL.</P>
- <P>
- <H2><A NAME="urls">urls</A></H2>
- <P>Return a reference to an array of urls.
- There is also a primary URL (<CODE>url</CODE>).
- See also <CODE>add_url</CODE>.</P>
- <P>
- <H2><A NAME="add_url">add_url</A></H2>
- <P>Add a URL to the list.</P>
- <P>
- <H2><A NAME="related_urls, add_related_url, related_titles, add_related_title">related_urls, add_related_url, related_titles, add_related_title</A></H2>
- <P>Analgous to urls, these functions provide lists of related URLs
- and their titles. These point to things the search engine thinks
- you might want.</P>
- <P>
- <H2><A NAME="title, description, score, change_date, index_date, size, raw">title, description, score, change_date, index_date, size, raw</A></H2>
- <P>Set or get attributes of the result.</P>
- <P>None of these attributes is guaranteed to be provided by
- a given backend. If an attribute is not provided
- its method will return <A HREF="../../../lib/Pod/perlfunc.html#item_undef"><CODE>undef</CODE></A>.</P>
- <P>Typical contents of these attributes:</P>
- <DL>
- <DT><STRONG><A NAME="item_title">title</A></STRONG><BR>
- <DD>
- The title of the hit result (typically that provided by the 'TITLE'
- HTML tag).
- <P></P>
- <DT><STRONG><A NAME="item_description">description</A></STRONG><BR>
- <DD>
- A brief description of the result, as provided (or not) by the search engine.
- Often the first few sentences of the document.
- <P></P>
- <DT><STRONG><A NAME="item_source">source</A></STRONG><BR>
- <DD>
- Source is either the base url for this result (as listed on the search
- engine's results page) or another copy of the full url path of the
- result. It might also indicate the source site address where the
- resource was found, for example, 'http://www.cnn.com' if the search
- result page said ``found at CNN.com''.
- <P>This value is backend-specific; in fact very few backends set this
- value.</P>
- <P></P>
- <DT><STRONG><A NAME="item_score">score</A></STRONG><BR>
- <DD>
- A backend specific, numeric score of the search result.
- The exact range of scores is search-engine specific.
- Usually larger scores are better, but this is no longer required.
- See normalized_score for a backend independent score.
- <P></P>
- <DT><STRONG><A NAME="item_normalized_score">normalized_score</A></STRONG><BR>
- <DD>
- SORRY, THIS IS NOT IMPLEMENTED.
- <P>This is intended to be a backend-independent score of the search
- result. The range of this score is between 0 and 1000. Higher values
- indicate better quality results.</P>
- <P></P>
- <DT><STRONG><A NAME="item_change_date">change_date</A></STRONG><BR>
- <DD>
- When the result was last changed.
- <P></P>
- <DT><STRONG><A NAME="item_index_date">index_date</A></STRONG><BR>
- <DD>
- When the search engine indexed the result.
- <P></P>
- <DT><STRONG><A NAME="item_size">size</A></STRONG><BR>
- <DD>
- The approximate size of the result, in bytes. This is only an
- approximation because search backends often report the size as
- ``18.4K''; the best we can do with that number is return it as the value
- of 18.4 * 1024.
- <P></P>
- <DT><STRONG><A NAME="item_raw">raw</A></STRONG><BR>
- <DD>
- The raw HTML for the entire result. Raw should be exactly the raw
- HTML for one entry. It should not include list or table setup
- commands (like ul or table tags), but it may include list item or
- table data commands (like li, tr, or td). Whether raw contains a list
- entry, table row, br-separated lines, or plain text is search-engine
- dependent. In fact, many backends do not even return it at all.
- <P></P></DL>
- <P>
- <H2><A NAME="company, location, source">company, location, source</A></H2>
- <P>More attributes of the result.</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::SearchResult - class for results returned from WWW::Search</P></STRONG>
- </TD></TR>
- </TABLE>
-
- </BODY>
-
- </HTML>
-