Achievements

3 views
Skip to first unread message

Toby

unread,
Nov 12, 2006, 1:17:38 PM11/12/06
to Geograph-API-Users
Doesn't seem much point having a discussion group with 9 members and
not discussing anything so I am going to create a couple of threads.

This first one is for members to show what they have done so far in
order for us to be able to compare notes and maybe spark off ideas for
future projects.

I have created a page at http://www.cullen.org/family/tzc_index.php. I
would like to claim that it is all my own work, but most of the clever
stuff was kindly provided by Barry Hunter and cloned from his
http://www.nearby.org.uk/geograph/latest.php page.

On my page I am showing the 3 most recent photos from anyone on
geograph and the 3 most recent photos of my own that have been
accepted.

Next thread will be future projects.

Happy geographing!

Toby

barryhunter

unread,
Nov 13, 2006, 5:32:33 AM11/13/06
to Geograph-API-Users
Thanks Toby for starting us off (and helping me to notice the
moderation steps are still enabled - will fix, should be little risk of
spam here yet :)

On topic, the page posted, links to the demo projects I have done using
the API, but not sure if:
http://www.nearby.org.uk/geograph-demo.php is linked yet...

I also have a more 'live' use of the API here, (the original impetus to
develop the API ;):
http://www.nearby.org.uk/lll.cgi
and a 'Google Maps Mashup' to same data
http://www.nearby.org.uk/google/
- although I have never taken the last step and created the
auto-fetching process.

Barry
Geograph Developer

On Nov 12, 6:17 pm, "Toby" <t...@cullen.org> wrote:
> Doesn't seem much point having a discussion group with 9 members and
> not discussing anything so I am going to create a couple of threads.
>
> This first one is for members to show what they have done so far in
> order for us to be able to compare notes and maybe spark off ideas for
> future projects.
>

> I have created a page athttp://www.cullen.org/family/tzc_index.php. I

Spiros Denaxas

unread,
Nov 13, 2006, 6:27:32 AM11/13/06
to geograph-...@googlegroups.com
Yep, thanks Toby for giving us food for thought. A small intro from me as well. I have currently finished the first version of the CPAN module for the Geograph API. It currently supports CSV and custom searches and validates all user input locally in order to save some resources on your side :)

A rough example :

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

The new constructor only accepts a single parameter, key, which is the API key to use the service. In case the user does not supply a key, an error message telling him to contact geograph etc is given.

The lookup function is where the good stuff happens. Users can specify a mode (which is either csv for CSV export or search for constructing new searches). It affectively creates a new WebService::Geograph::Request object and executes it.

my $rd = $g->lookup('csv', {                     'i'        => 12345,
                                                             'dist_sqd' => 2,
                                                             'thumb'    => 1,
                                                             'll'       => 1,
                                                             'page'     => 1,
                                                             'count'    => 6,  } ) ;



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

or

my $rv = $api->lookup ( 'search ', { q = 'W12 8JL' } ) ;
my $inumber = $rv->{results}

The object returned is an WebService::Geograph::Response object which essentially is an HTTP::Response object with some extra parameters ive added:

$obj->{success} = 0 or 1
$obj->{results} = holds the data
$obj->{error_code} and $obj->{error_message} used for error tracking.

I am finishing the last POD stuff today and uploading it to CPAN. Feedback, comments and flames more than welcome :)

Spiros
Reply all
Reply to author
Forward
0 new messages