WWW::MelbourneBikeShareU(s3e)r Contributed Perl DocumentaWtWiWo:n:MelbourneBikeShare(3)



NNAAMMEE
       WWW::MelbourneBikeShare - Simple interface to the Melbourne Bike Share
       open data set.

SSYYNNOOPPSSIISS
       This module provides a simple interface to the Melbourne Bike Share
       open data set
       (<https://data.melbourne.vic.gov.au/Transport-Movement/Melbourne-bike-share/tdvh-n9dv>).

       The Melbourne Bike Share open data set provides up to date information
       on the number of available bikes and slots available at each Melbourne
       Bike Share terminal.  The data set also provides terminal metadata
       including; the terminal friendly name, the terminal ID, the terminal
       geographical coordinates, and a time stamp indicating the time at which
       the terminal data was last updated.

               use WWW::MelbourneBikeShare;

               my $mbs = WWW::MelbourneBikeShare->new;

               # Get a list of all Melbourne Bike Share terminals as an array of
               # WWW::MelbourneBikeShare::Terminal objects.

               my @terminals = $mbs->terminals;

               # Print the ID, name, and number of bikes available at each terminal.

               map {
                       printf( "%-3s %-65 %-4s\n", $_->id, $_->name, $_->bikes )
               } @terminals;

               # Do the same thing, but order the list by the number of available bikes.
               map {
                       printf( "%-3s %-65 %-4s\n", $_->id, $_->name, $_->bikes
               } $mbs->by_available_bikes;

               # Or, by proximity to our current location.
               map {
                       printf( "%-3s %-65 %-4s\n", $_->id, $_->name, $_->bikes
               } $mbs->by_distance( -37.816181, 144.952688 );

               # Get our closest terminal.
               my $t = $mbs->nearest( -37.816181, 144.952688 );

               # And print some information about it.
               print "Our closest terminal is " . $t->name
                       ." (ID ". $t->id . ") "
                       ." located approximately ". $t->distance( -37.816181, 144.952688 )
                       ."km away at ". $t->lat ", ". $t->lon .".\n\n"
                       ."The terminal currently has ". $t->bikes ." bikes available and "
                       . $t->empty . " empty slots.\n\n";

MMEETTHHOODDSS
   nneeww (( ccaacchhee ==>> $$CCAACCHHEE__TTIIMMEE ))
       Constructor method - creates a new WWW::MelbourneBikeShare object.

       Accepts one optional parameter: ccaacchhee which allows the caller to
       specify the maximum cache time for retrieved data.

       The data set is currently updated every fifteen minutes and typically
       within a short period following the quarter hour interval (e.g. 09:00,
       09:15, 09:30, 09:45).  If no cache parameter is supplied to the
       constructor, then a maximum cache duration of 900s will be used - this
       reduces the volume of requests required to be made to the data
       provider.

       Under most circumstances, it should not be necessary to provide a cache
       argument to the constructor as the default value should be sufficient.
       If you explicitly want to refresh the cache (e.g. you are using a local
       time source to determine the update interval) then you may explicitly
       invalidate the cache by callling the "refresh" method.

   rreeffrreesshh
       Explicitly invalidate the local cache and cause the data set to be
       retrieved from the data provider.

   tteerrmmiinnaallss
       Get a list of all Melbourne bike share terminals as an array of
       WWW::MelbourneBikeShare::Terminal objects.  The order of the terminals
       is the same as is returned in the data set by the provider.

   bbyy__iidd
       Get a list of all Melbourne bike share terminals as an array of
       WWW::MelbourneBikeShare::Terminal objects ordered by id. Note that the
       iidd is different to the terminal id value returned by the tteerrmmiinnaall
       method.

   bbyy__tteerrmmiinnaall
       Get a list of all Melbourne bike share terminals as an array of
       WWW::MelbourneBikeShare::Terminal objects ordered by terminal id.

   bbyy__aavvaaiillaabbllee__bbiikkeess
       Get a list of all Melbourne bike share terminals as an array of
       WWW::MelbourneBikeShare::Terminal objects ordered by the number of
       available bikes.

   bbyy__aavvaaiillaabbllee__ddoocckkss
       Get a list of all Melbourne bike share terminals as an array of
       WWW::MelbourneBikeShare::Terminal objects ordered by the number of
       available bike docks.

   bbyy__ddiissttaannccee (( $$LLAATT,, $$LLOONN ))
       Get a list of all Melbourne bike share terminals as an array of
       WWW::MelbourneBikeShare::Terminal objects ordered by distance from the
       provided geographical coordinates.

   iidd (( $$IIDD ))
       Return the terminal with the given ID as a
       WWW::MelbourneBikeShare::Terminal object.

   tteerrmmiinnaall
       Return the terminal with the given terminal ID as a
       WWW::MelbourneBikeShare::Terminal object.

   cclloosseesstt  (( $$LLAATT,, $$LLOONN )) RReettuurrnn tthhee ggeeooggrraapphhiiccaallllyy nneeaarreesstt tteerrmmiinnaall aass aa
       WWWWWW::::MMeellbboouurrnneeBBiikkeeSShhaarree::::TTeerrmmiinnaall oobbjjeecctt vviiaa ddiissttaannccee ffrroomm tthhee pprroovviiddeedd
       ggeeooggrraapphhiiccaall ccoooorrddiinnaatteess..
AAUUTTHHOORR
       Luke Poskitt, "<ltp at cpan.org>"

BBUUGGSS
       Please report any bugs or feature requests to
       "bug-www-melbournebikeshare at rt.cpan.org", or through the web
       interface at
       <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WWW-MelbourneBikeShare>.
       I will be notified, and then you'll automatically be notified of
       progress on your bug as I make changes.

SSUUPPPPOORRTT
       You can find documentation for this module with the perldoc command.

           perldoc WWW::MelbourneBikeShare

       You can also look for information at:

       ·   RT: CPAN's request tracker (report bugs here)

           <http://rt.cpan.org/NoAuth/Bugs.html?Dist=WWW-MelbourneBikeShare>

       ·   AnnoCPAN: Annotated CPAN documentation

           <http://annocpan.org/dist/WWW-MelbourneBikeShare>

       ·   CPAN Ratings

           <http://cpanratings.perl.org/d/WWW-MelbourneBikeShare>

       ·   Search CPAN

           <http://search.cpan.org/dist/WWW-MelbourneBikeShare/>

       ·   Melbourne Bike Share open data set

           <https://data.melbourne.vic.gov.au/Transport-Movement/Melbourne-bike-share/tdvh-n9dv>

SSEEEE AALLSSOO
       WWW::MelbourneBikeShare::Terminal

LLIICCEENNSSEE AANNDD CCOOPPYYRRIIGGHHTT
       Copyright 2017 Luke Poskitt.

       This program is free software; you can redistribute it and/or modify it
       under the terms of the the Artistic License (2.0). You may obtain a
       copy of the full license at:

       <http://www.perlfoundation.org/artistic_license_2_0>

       Any use, modification, and distribution of the Standard or Modified
       Versions is governed by this Artistic License. By using, modifying or
       distributing the Package, you accept this license. Do not use, modify,
       or distribute the Package, if you do not accept this license.

       If your Modified Version has been derived from a Modified Version made
       by someone other than you, you are nevertheless required to ensure that
       your Modified Version complies with the requirements of this license.

       This license does not grant you the right to use any trademark, service
       mark, tradename, or logo of the Copyright Holder.

       This license includes the non-exclusive, worldwide, free-of-charge
       patent license to make, have made, use, offer to sell, sell, import and
       otherwise transfer the Package with respect to any patent claims
       licensable by the Copyright Holder that are necessarily infringed by
       the Package. If you institute patent litigation (including a cross-
       claim or counterclaim) against any party alleging that the Package
       constitutes direct or contributory patent infringement, then this
       Artistic License to you shall terminate on the date that such
       litigation is filed.

       Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER
       AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
       THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
       PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY
       YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR
       CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR
       CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE,
       EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.



perl v5.18.2                      2017-01-23        WWW::MelbourneBikeShare(3)
