[aprssig] RE: user defined pages
Brad McConahay
brad at n8qq.com
Tue May 10 15:29:57 EDT 2005
Hey Wes,
Yeah, it's occurred to me that some conditional testing would be nice for a
variety of reasons, not the least of which is zero vs. null values. I
should be able to implement some sort of if/else structures with another
shot of free time on the weekend.
Expanding functionality of this system (which could use a good short name)
will happen naturally over time if/as more people look to do various things
with it, but I wonder at what point a user is doing enough scripting that
they would be better served by just doing it in perl or similar and directly
using the XML interface (http://aprs.n8qq.com/xml). I'd be happy to provide
the few lines of perl it takes to pull data from the XML server and populate
an array with it, for anybody who would be interested. Of course, that
would also require that the user's server offers perl and allows cgi
scripting, and that the user knows how to install perl modules, and has
access to do so, etc...
Anyway, all the ideas you mention are great, but I'll take a look at
specifically adding conditional statements this weekend or thereabouts.
Wes Johnston sez:
>
> (here we go.....)
>
True dat! :-D
Brad N8QQ
-----Original Message-----
From: Wes Johnston [mailto:aprs at kd4rdb.com]
Sent: Tuesday, May 10, 2005 1:58 PM
To: brad at n8qq.com; TAPR APRS Mailing List
Subject: user defined pages
I brought up this page through your proxy
http://aprs.n8qq.com/replace/index.cgi?call=kd4rdb-14&url=www.kd4rdb.com/whe
re.html
and because my speed is 0, I got a blank instead of a 0..... which makes
my page read kinda funny.
Sure would be nice if (here we go.....) there was some sort of scripting
that could be used....
$callsign is
if $speed=0 {
"parked"
}
else if $speed<60 {
"driving $dir at $speed mph"
}
else if $speed>=60 {
"speeding $dir at $speed mph"
}
Of course this scripting could lead to other things like:
if $lat>33.58 and $lat<33.59 and $lon>80.99 and $lon<81.00 then {
"Joe is at work".
And the neat thing for that would be to have the user provide a distance
and a target point... so I could say "he's near walmart" or "he's at
home" instead of simply printing the lat/lon. Perhaps setup the call
like a function..... $distance(.01,33.8034,-80.4435) could yield a
result of 1 for > range, or 0 for <range. Although I know it's not
correct for large distances, a very simple way to do distance calcs is
to compensate for east-west distance by using the COS of lattitude, then
use Pythagrus' Theorum to determine the number of (or fraction of
degrees) between the two points. Then it's just a matter of multiplying
the number of degrees by 69 for miles.
I wrote a script for a home automation program a couple of years ago
that would query findu and determine if I was at ("at" was defined at
<.1 of a mile) several local land marks around town and read the results
over my PC speakers using text to speech. And _that_ was neat b/c the
way you triggered the script was to say "computer, where is my car", and
it would respond with "Your car is at the mall" or "Your car is 2.3
miles north of Sumter travelling 60mph".
This is a really neat idea for a proxy you have!.... esp when one
considers that we could use a URL redirection like those offered at
www.no-ip.org ... they offer free subdomains at zapto.org for
instance... so wes.zapto.org could redirect users to my page via your proxy.
Wes
More information about the aprssig
mailing list