[OZAPRS] PERL APRS split code

Andrew Rich vk4tec at hotmail.com
Wed Oct 1 21:38:42 EST 2003


For those interested in learning more about APRS, here is my latest code
in 
PERL.
Splits the APRS stream up into relevant bits, callsign, dest, digis, 
payload, email, webpage.
For those interested in learning more about APRS, here is my latest code
in 
PERL.
Splits the APRS stream up into relevant bits, callsign, dest, digis, 
payload, email, webpage.

--------------------------------------------------------------------------
------------------------------
calls: 
VK3XJB>APU250,VK3RMG-1,VK3CV-1*,TRACE3-1,qAO,VK3SB:@011126z3622.50S/14524.
33E_101/004g008t051r000P067h97b09980/ 
Shepparton.   Ulyssian {UIV32N}
dest :  APU250
digis:  VK3RMG-1,VK3CV-1*,TRACE3-1,qAO,VK3SB
payld:  @011126z3622.50S/14524.33E_101/004g008t051r000P067h97b09980/ 
Shepparton.   Ulyssian {UIV32N}
email:
webpg:
--------------------------------------------------------------------------
------------------------------

#!/usr/bin/perl
use Net::Telnet;
my $host = "aprs.net.au";
my (@data, $line);
my $t = new Net::Telnet(Timeout=> '5', port => '10153');
$t->errmode('return');
$t->Net::Telnet::open($host);
sleep 5;
print $t "user VK4TEC pass <pass> vers XASTIR \n";
while (<$t>)
{
chop;
$email="";
$webpg="";
if (m/.*\s+([a-zA-Z0-9\+_.-]+)\@([a-zA-Z0-9.-]+)\s+/)
{
$email = $1."@".$2;
}
if (m/http:\/\/([a-zA-Z0-9.-]+)\s+/)
{
$webpg = $1;
}
($callsign, $rest) = split(/>/,$_,2);
($dest, $rest) = split(/,/,$rest,2);
($digis, $payload) = split(/:/,$rest,2);
$payload =~ s/'/\\'/g,$payload;
print 
"-------------------------------------------------------------------------
-------------------------------\n";
print "data :  $_";
print "calls:  $callsign\n";
print "dest :  $dest\n";
print "digis:  $digis\n";
print "payld:  $payload\n";
print "email:  $email\n";
print "webpg:  $webpg\n";
}

_________________________________________________________________
Get less junk mail with ninemsn Premium. Click here  
http://ninemsn.com.au/premium/landing.asp

_______________________________________________
ozaprs mailing list
ozaprs at marconi.ics.mq.edu.au
http://marconi.ics.mq.edu.au/cgi-bin/mailman/listinfo/ozaprs



More information about the Ozaprs mailing list