#ABSTRACT: Subroutines for FR24-Bot
package FR24::Bot;
use v5.12;
use warnings;
use JSON::PP;
use Data::Dumper;
use Exporter qw(import);
use HTTP::Tiny;
use File::Which;
use FR24::Utils;
use Carp qw(c
signs} = {};
$self->{flights_url} = "http://" . $self->{ip} . ":" . $self->{port} . "/flights.json";
$self->{users} = {};
$self->{last_updated} = 0;
$self->{last_url} = undef;
$se
ion 0.0.3
=head1 SYNOPSIS
use FR24::Bot;
my $bot = FR24::Bot->new(
-conf => "config.json",
-name => "bot_1"
);
$bot->update();
=head1 DESCRIPTION
The FR24::Bot module prov
'uploaded' => 3,
'last_url' => 'http://localhost:8754/flights.json?time=1689326300000',
'name' => 'fr24-bot',
'callsigns' =>
'content' => '{}',
'flights_url' => 'http://localhost:8754/flights.json',
'localip' => undef,
'flights' => {
#ABSTRACT: Subroutines for FR24-Bot
use v5.12;
use warnings;
package FR24::Utils;
use JSON::PP;
use Exporter qw(import);
use HTTP::Tiny;
use File::Which;
# Export version
our @EXPORT = qw($VERSION);
o
running'} = $1;
}
}
}
sub parse_flights {
my ($json_text, $test) = @_;
if (defined $test and $test > 0) {
$json_text = '{"485789":["485789",51.94,0.9666,64.76496,38275,539,"6
if (length($json_text) == 0) {
return $answer;
}
my $json = JSON::PP->new->utf8->pretty->canonical;
my $json_data;
eval {
$json_data = $json->decode($json_text);