FR24-Bot
view release on metacpan or search on metacpan
lib/FR24/Bot.pm view on Meta::CPAN
$self->{last_url} = undef;
$self->{test_mode} = $test_mode;
$self->update();
return $self;
}
sub _timestamp_milliseconds {
return int(time * 1000);
}
sub update {
my $self = shift;
my $timestamp = _timestamp_milliseconds();
if ($timestamp - $self->{last_updated} < $self->{refresh}) {
# Update only once per second
return;
}
$self->{last_updated} = $timestamp;
my $url = $self->{flights_url} . "?time=" . _timestamp_milliseconds();
$self->{last_url} = $url;
( run in 0.280 second using v1.01-cache-2.11-cpan-4d4bc49f3ae )