[aprssig] findu.com and ui_view cgi suggestion
Andrew Rich
vk4tec at tech-software.net
Fri Jul 29 22:15:41 EDT 2005
Steve,
I know you do not allow direct access to your database. Thats fair enough.
Can I make this suggestion.
1) Make a CGI where you can specify and IP address, port, and filter.
2) The CGI extracts the data you want, and replays to the IP address and
port you want (UI-VIEW etc)
3) This would get around the direct connection problem.
Suggested URL syntax
http://www.findu.com/cgi-bin/rawsend.cgi?IP=192.168.11.22&PORT=1448&FILTER=V
K4
Suggested code
http://www.findu.com/cgi-bin/rawsend.cgi
#!/usr/bin/perl
#-----------------------------------------------------------------
# Collect data and send to client - Andrew Rich VK4TEC July 2005
#-----------------------------------------------------------------
use Net::Telnet;
use DBI;
#-----------------------------------------------------------------
# Try to connect to remote
#-----------------------------------------------------------------
my $host = "the aprs client ip address to send to";
my $user = "";
my $password = "";
my $prompt = "";
my $t = new Net::Telnet(Timeout => '5',port => '14481');
$t->errmode('return');
$t->Net::Telnet::open($host) or die "Could not connect";
#-----------------------------------------------------------------
# Connect to MySQL and send data to remote
#-----------------------------------------------------------------
my $database_handler =
DBI->connect("DBI:mysql:aprs:host=localhost;mysql_socket=/tmp/mysql.sock","r
oot","");
$sql = "select * from raw_data where field like '%filter%'";
statement_handler=$database_handler->prepare ($sql));
$statement_handler->execute;
while (($raw_data) = $statement_handler-> fetchrow() )
{
print $t;
}
$statement_handler->finish;
#-----------------------------------------------------------------
# Close connection
#-----------------------------------------------------------------
$t->close();
More information about the aprssig
mailing list