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 (http://www.nestoria.co.uk), a vertical search engine for property listings in the UK.
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' );
@listings is an array of WebService::Nestoria::Search::Result objects.
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.
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 is currently useless because the only correct value to give it is 'uk', to which it already defaults.
It affects the URL which is used for fetching results. For example 'uk' gives http://api.nestoria.co.uk/api, in the future 'fr' might give ..nestoria.fr..
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.