NAME
WWW::SearchResult - class for results returned from WWW::Search
SYNOPSIS
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();
DESCRIPTION
A framework for returning the results of WWW::Search
.
SEE ALSO
METHODS AND FUNCTIONS
new
To create a new WWW::SearchResult, call $search = new WWW::SearchResult();
url
Return the primary URL. Note that there may be a list of urls, see also methods urls
and add_url
. Nothing special is guaranteed about the primary URL other than that it's the first one returned by the back end.
Every result is required to have at least one URL.
urls
Return a reference to an array of urls. There is also a primary URL (url
). See also add_url
.
add_url
Add a URL to the list.
related_urls, add_related_url, related_titles, add_related_title
Analgous to urls, these functions provide lists of related URLs and their titles. These point to things the search engine thinks you might want (for example, see Infoseek).
title, description, score, change_date, index_date, size, raw
Set or get attributes of the result.
None of these attributes is guaranteed to be provided by a given back-end. If an attribute is not provided its method will return undef
.
Typical contents of these attributes:
- description A brief description of result. Often the first few sentences of the document.
- score A back-end 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 back-end independent score.
- normalized_score A back-end independent score of the search result. The range of this score is between 0 and 1000. Higher values indicate better quality results.
- change_date When the result was last changed.
- index_date When the search engine indexed the result.
- size The size of the result, in bytes.
- raw The raw HTML for the entire result.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 165:
=over should be: '=over' or '=over positive_number'