DAPNET::API - Use the DAPNET API from Perl
my($dapnetobj) = DAPNET::API->new({ DAPNET_USERNAME => '<username>', DAPNET_PW => '<password>', CALLSIGN => '<your callsign>' });
$ret = $dapnetobj->send_rubric_content(<text to send>,<rubric name>.<transmitter group name>,<sequence number 1 - 10>);
$ret = $dapnetobj->send_individual_call(<text>,<destination callsign>,<transmitter group name>,<emergency boolean>));
if ($ret) { print('HTTP Error response: '.$ret."\n"); } else { print("Message sent\n"); }
Implementation of the DAPNET REST API in Perl.
Simon (G7RZU) <simon@gb7fr.org.uk>
This section describes the methods that are implemented and their use.
Instantiates new object. Pass a hash reference with options as follows
my($dapnetobj) = DAPNET::API->new({ DAPNET_USERNAME => '<username>', DAPNET_PW => '<password>', CALLSIGN => '<your callsign>' DEBUG => [0|1] });
returns an object if sucessful or false if not sucessful
Returns a hash ref to the last JSON response or undef if there is none $jsonhashref = $jsonobj->json_response;
Send a call to a single callsign
Returns 0 on sucess or the HTTP error string on error.
Sends a message to a rubric
$ret = $dapnetobj->send_rubric_content(<text to send>,<rubric name>.<transmitter group name>,<sequence number 1 - 10>,<send call? [0|1]>);
To install DAPNET::API, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DAPNET::API
CPAN shell
perl -MCPAN -e shell install DAPNET::API
For more information on module installation, please visit the detailed CPAN module installation guide.