WWW::SearchResult(3pm) | User Contributed Perl Documentation | WWW::SearchResult(3pm) |
WWW::SearchResult - class for results returned from WWW::Search
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();
A framework for returning the results of "WWW::Search".
WWW::Search
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.)
To create a new WWW::SearchResult, call
$result = new WWW::SearchResult();
Returns 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 is the first one returned by the back end.
Every result is required to have at least one URL.
Add a URL to the list.
Return a reference to the list of urls. There is also a primary URL ("url").
Add a URL to the related_url list.
Return a reference to the list of related urls.
Add a title to the list or related titles.
Return a reference to the list of related titles.
Set or get attributes of the result.
None of these attributes is guaranteed to be provided by a given backend. If an attribute is not provided its method will return "undef".
Typical contents of these attributes:
This value is backend-specific; in fact very few backends set this value.
This is not really implemented since no one has created an backend-independent ranking algorithm.
More attributes of the result. Backend-specific. Refer to the documentation of each backend for details.
WWW::SearchResult was written by John Heidemann. WWW::SearchResult is maintained by Martin Thurn.
2020-09-10 | perl v5.30.3 |