WWW::Velib::Map Process the Velib' map information
This document describes version 0.02 of WWW::Velib::Map, released 2007-11-13.
Download a the Velib' map information from the web. The information may be cached locally (see the
savemethod). A previously saved map file may be loaded by specifying it with the
my $map = WWW::Velib::Map->new; # download from the web my $m2 = WWW::Velib::Map->new(file => 'map.data'); # use local file
In the latter example, the method will croak if the file does not exist or cannot be decoded.
Save the downloaded map information into a local file. The method will croak if the file cannot be written.
Search the station list for the stations that match some criteria. Returns an array of
Currently, one may search for stations near a given station, limited by either number or distance (in metres). The stations may be queried for current details (availabale bikes and slots).
Search by distance (returns all the stations within n metres):
my @station = $m->search( station => 1234, distance => 600 );
To obtain the status of each station, use the
my @station = $m->search( station => 2345, distance => 500, status => 1, );
Search by number (returns the n closest stations):
my @station = $m->search( station => 1234, n => 4 );
Nota bene: the official map contains many errors. Alternate maps of better quality exist and will be used in a future version.
Returns a reference to a hash of all the stations in the map, keyed by station number.
David Landgren, copyright (C) 2007. All rights reserved.
If you (find a) use this module, I'd love to hear about it. If you want to be informed of updates, send me a note. You know my first name, you know my domain. Can you guess my e-mail address?
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.