NAME
WebService::Nestoria::Search - Perl interface to the Nestoria Search public API.
SYNOPSIS
WebService::Nestoria::Search provides a Perl interface to the public API of Nestoria a vertical search engine for property listings. Nestoria currently has listings for the UK and Spain, which can be accessed via the world-wide web at www.nestoria.co.uk and www.nestoria.es
use WebService::Nestoria::Search;
my @listings = WebService::Nestoria::Search->results( place_name => 'soho', listing_type => 'let', property_type => 'flat', price_max => '500', number_of_results => '10', sort => 'price_lowhigh', keywords => 'garden,hot_tub,mews', keywords_exclude => 'cottage,wood_floor' );
@listings is an array of WebService::Nestoria::Search::Result objects.
For more information about parameters and possible keywords visit http://www.nestoria.co.uk/help/api-tech
FUNCTIONS
new
Creates a WebService::Nestoria::Search object. On error sets $@
and returns undef
.
If given 'request' arguments (eg. place_name, listing_type) these become defaults for calls to Request.
%args = ( Warnings => 0, listing_type => 'let' );
$NS = WebService::Nestoria::Search->new( %args );
request
Creates a WebService::Nestoria::Search::Request object. On error sets $@
and returns undef
$request = WebService::Nestoria::Search->request( %args );
query
Creates an implicit Request object and returns the resulting Response. On error, sets $@
and returns undef
.
$response = WebService::Nestoria::Search->query( %args );
results
Creates an implicit Request
object, then an implicit Response
object, and returns an array of Result
objects. On error, sets $@
and returns undef
.
@results = WebService::Nestoria::Search->results( %args );
test_connection
Uses the API feature 'action=echo' to test the connection.
Returns 1 if the connection is successful and 0 otherwise.
$rv = WebService::Nestoria::Search->test_connection();
keywords
Uses the API feature 'action=keywords' to return a list of valid keywords.
@keywords = WebService::Nestoria::Search->keywords();
AutoCarp
AutoCarp is true by default and means that errors are output to STDERR as well as being returned via $@. This can be turned off by adding
AutoCarp => 0
to the parameters to WebService::Nestoria::Search::new()
TODO: People should be able to 'AutoCarp => 0' on the use line
Country
Country is an optional parameter which defaults to 'uk'. It affects the URL which is used for fetching results.
Currently the available countries are 'uk', for the United Kingdom, and 'es', for Spain.
Copyright
Copyright (C) 2006 Lokku Ltd.
Author
Alex Balhatchet (kaoru@slackwise.net)
Acknowledgements
A lot of the ideas (and yes, very occasionally entire functions) for these modules were borrowed from Jeffrey Friedl's Yahoo::Search.