Λόρδος Σπύρος Δεναξάς > WebService-Geograph-API-0.05 > WebService::Geograph::API

Download:
WebService-Geograph-API-0.05.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.05   Source  

NAME ^

WebService::Geograph::API - Perl interface to the Geograph.co.uk API

SYNOPSIS ^

  use WebService::Geograph::API;
  
  my $api = new WebService::Geograph::API ( { 'key' => 'your_api_key_here'} ) ;

  my $rv = $api->lookup ( 'csv', { 'i'     => 12345,
                                   'll'    => 1,
                                   'thumb' => 1,
                                 }) ;

  my $data = $rd->{results} ;

DESCRIPTION ^

This module provides a simple interface to using the geograph.co.uk API service.

The actual core class, WebService::Geograph::API is a subclass of LWP::UserAgent so all the usual parameters apply.

METHODS

new

The following constructing method creates a new WebService::Geograph::API object and returns it. It accepts a single parameter, key, which is the API key for the service. You must obtain a valid key otherwise you will not be able to use the API.

Obtaining a key is free. See : http://www.geograph.org.uk/help/api#api for more information.

        my $api = new WebService::Geograph::API ( { 'key' => 'your_api_key_here'} ) ;
lookup

Creates a new WebService::Geograph::Request object and executes it.

        my $rv = $api->lookup ( 'csv', { 'i' => 12345, 'll' => 1, } ) ;
        
        or
        
        my $rv = $api->lookup ( 'search ', { q = 'W12 8JL' } ) ;

Valid modes at the moment include csv for exporting CSV and search for creating custom searches and obtaining their 'i' number. A very good and detailed overview of the various parameters they support can be find on the API page located at : http://www.geograph.org.uk/help/api#api

This method creates and returns a new WebService::Geograph::Response object. The object is a standard HTTP::Response object with some additional fields. If no errors occur, the results of the query will be located inside results ;

        my $data = $rv->{results} ;
execute_request

Internal method that executes a request and blesses the response into a WebService::Geograph::Response object.

create_results_node

Intenal method which assigns the actual data returned from the API within the response objects 'results' key.

SUPPORT ^

Please feel free to send any bug reports and suggestions to my email listed below.

For more information and useless facts on my life, you can also check my blog:

  http://idaru.blogspot.com/

AUTHOR ^

    Spiros Denaxas
    CPAN ID: SDEN
    Lokku Ltd ( http://www.nestoria.co.uk )
    s [dot] denaxas [@] gmail [dot]com

COPYRIGHT ^

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.

SEE ALSO ^

WebService::Geograph::Request, WebService::Geograph::Response, http://www.geograph.co.uk, http://www.geograph.org.uk/help/api#api

syntax highlighting: