OpenGbg::Service::TrafficCamera::GetCameraImage - Get the current image from a traffic camera
Version 0.1404, released 2018-05-19.
use Path::Tiny; my $camera_id = 30; my $traffic_camera_service = OpenGbg->new->traffic_camera; my $get_camera_image = $traffic_camera_service->get_camera_image($camera_id); say sprintf '%s bytes', $get_camera_image->size; path(sprintf 'image-%s-%s.jpg', time, $camera_id)->spew($get_camera_image->image);
Integer. The image size in bytes. Sometimes cameras are out-of-order, and returns a dummy image. These are at the time of writing less than 10kb, and is therefore useful to filter on (if these images are unwanted).
A DateTime object, rounded down to the closest minute. The timestamp of the image is not given in the response from the web service. This DateTime object is created as a convenience.
Erik Carlsson <firstname.lastname@example.org>
This software is copyright (c) 2016 by Erik Carlsson.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.