WWW::S...hResult(3pm)
π NAME π
WWW::SearchResult is the class for results returned from WWW::Search, and honestly? Itβs giving main-character energy for your search hits, bestie.
β¨ SYNOPSIS β¨
Hereβs the little summoning ritual:
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 π¦
Itβs a framework for returning the results of WWW::Search β like the cute little result-delivery system that hands your hits back to you. Periodt.
π SEE ALSO π
WWW::Searchβ go peek at the main search module too, bestie.
π REQUIRED RESULTS π
Okay so the particular fields returned in a result are backend- (search engine-) dependent. Every backend has its own little personality, no cap. However, all search engines are required to return a url and a title. This list may grow in the future, so stay tuned. π
π METHODS AND FUNCTIONS π
Youβre gonna be obsessed with these.
π new
To create a new WWW::SearchResult, call:
$result = new WWW::SearchResult();
π url
Returns the primary URL. Note that there may be a list of urls, so 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_url
Add a URL to the list.
π urls
Return a reference to the list of urls. There is also a primary URL (url).
π§ add_related_url
Add a URL to the related_url list.
π related_urls
Return a reference to the list of related urls.
β¨ add_related_title
Add a title to the list of related titles.
π·οΈ related_titles
Return a reference to the list of related titles.
π«Ά 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 backend. If an attribute is not provided, its method will return undef.
Typical contents of these attributes:
titleβ The title of the hit result (typically that provided by the'TITLE'HTML tag).descriptionβ A brief description of the result, as provided (or not) by the search engine. Often the first few sentences of the document.sourceβ 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 name or address whence the result came β for example,'CNN'or'http://www.cnn.com'if the search result page said βfound at CNN.comβ. This value is backend-specific; in fact very few backends set this value.add_sourcesβ Same meaning assourceabove, for adding sources in case there are potentially multiple sources.sourcesβ Returns a reference to the list of sources.scoreβ 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. Seenormalized_scorefor a backend-independent score.normalized_scoreβ This is intended to be a backend-independent score of the search result. The range of this score is between0and1000. Higher values indicate better quality results.
This is not really implemented since no one has created a backend-independent ranking algorithm. π
change_dateβ When the result was last changed. Typically this is the modification time of the destination web page.index_dateβ When the search engine indexed the result.sizeβ 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 of18.4 * 1024.rawβ The raw HTML for the entire result.rawshould be exactly the raw HTML for one entry. It should not include list or table setup commands (likeulortabletags), but it may include list item or table data commands (likeli,tr, ortd). Whetherrawcontains 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.as_HTMLβ Convert the search result to a human-readable form, decorated with HTML for pretty-printing.
πΈ Others
More attributes of the result. Backend-specific. Refer to the documentation of each backend for details.
bid_amountbid_countbiddercategorycompanyend_dateimage_urlitem_numberlocationquestion_countsellershippingsoldstart_datethumb_urlwatcher_count
π AUTHOR π
WWW::SearchResult was written by John Heidemann. WWW::SearchResult is maintained by Martin Thurn. Give them their flowers. π
β¨ thatβs the whole page, bestie! it comes from the User Contributed Perl Documentation, perl v5.30.3, dated 2020-09-10 β now go get those search results π
π¦ where this page comes from
- debian bookworm: libwww-search-perl 2.51.90+~cs6.78-2 Β· USC
- debian trixie: libwww-search-perl 2.51.90+~cs6.78-2 Β· USC
- ubuntu jammy: libwww-search-perl 2.51.90+~cs6.78-2 Β· USC
- ubuntu noble: libwww-search-perl 2.51.90+~cs6.78-2 Β· USC
- ubuntu resolute: libwww-search-perl 2.51.90+~cs6.78-2 Β· USC
- ubuntu stonking: libwww-search-perl 2.51.90+~cs6.78-2 Β· USC
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms