NAME

WWW::Velib::Station - Details of Velib' station bicycle and parking availability

VERSION

This document describes version 0.01 of WWW::Velib::Station, released 2007-11-13.

SYNOPSIS

use WWW::Velib::Station;

my $s = WWW::Velib::Station->new(2007);
print $s->available, $/; # hopefully a positive number

DESCRIPTION

METHODS

new

Create a WWW::Velib::Station object. A single input parameter is given, representing the station number.

make

Create a WWW::Velib::Station object, based on the geographic information provided by WWW::Velib::Map. Not expected to be called from client code.

load_v1

Create a WWW::Velib::Station object, based on locally-cached contents of the geographic information provided by WWW::Velib::Map. Not expected to be called from client code.

coords

Returns a two-element list containing the theta and phi coordinates of the station.

distance_from

Returns the distance in metres of a station from the current station. The result is rounded by default to the nearest 5 metres.

my $depart; # two WWW::Velib::Station objects
my $arrive;
my $distance = $depart->distance_from($arrive);

To round off to another interval, specify the rounding as a second parameter:

my $dist_km = $depart->distance_from($arrive, 1000);
number

Returns the number (indentifier) of the station.

open

Indicates whether the station is open for business or not.

name

Returns the name of the station.

latitude

Returns the station's latitude, in degrees.

longitude

Returns the station's longitude, in degrees.

address

Returns the short address of the station.

full_address

Returns the full address of the station.

refresh

If a station has been built by loading a map, the following details will not be loaded (it takes time to fetch a couple of thousand web pages). This method will fetch the current status of the station (bikes available, slots available). On a long-running process, may be called repeatedly (at a suitable interval) to update the status.

available

Returns the number of bicycles available at the specified station.

total

Returns the total number of bicycle posts installed at the station.

free

Returns the number of bicycle posts that are able to receive a bicycle.

disabled

Returns the number of bicycle posts that are locked or have a locked bicycle attached.

AUTHOR

David Landgren, copyright (C) 2007. All rights reserved.

http://www.landgren.net/perl/

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?

LICENSE

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