[App_rpt-users] Find nodes that are talking

Florian Schmid dl1flo at u01.de
Sun Aug 9 11:16:46 UTC 2015


Hi,
I hope it works, here is the sourcecode:

----

<?
$quelltext = file_get_contents("http://stats.allstarlink.org");
$quelltext = str_replace("
", "", $quelltext);
$quelltext = str_replace("</tr>", "<br>", $quelltext);
$quelltext = str_replace("</td>", ";", $quelltext);
$quelltext = str_replace("<td>", "", $quelltext);
$quelltext = str_replace(";
", ";", $quelltext);
$quelltext = str_replace("; ", ";", $quelltext);
$quelltext = str_replace("; ", ";", $quelltext);
$quelltext = str_replace("<tr class=\"even-row\">", "", $quelltext);
$quelltext = str_replace("<tr class=\"odd-row\">", "", $quelltext);
$quelltext = substr($quelltext, strpos($quelltext, "Click here for")+39);
$quelltext = str_replace("<a href=\"nodeinfo.cgi?node=", "", $quelltext);
$quelltext = str_replace("\">", ";", $quelltext);
$quelltext = str_replace("</a>", "", $quelltext);
$quelltext = str_replace(";<br>", "<br>", $quelltext);
$quelltext = substr($quelltext, 0, strpos($quelltext, "<br></table>"));

$list = explode("<br>", $quelltext);

for ($i = 0; $i < count($list); $i++) {
	$list[$i] = explode(";",$list[$i]);
}

for ($i = 0; $i < count($list); $i++) {
	$duration = $list[$i][6];
	$d=0;
	$h=0;
	$m=0;
	$s=0;
	if (strpos($duration, "D") > 0)
	{
	$d = substr($duration, 0, strpos($duration, "D"));
	$duration = substr($duration, strpos($duration, "D")+1);
	}
	if (strpos($duration, "H") > 0)
	{
	$h = substr($duration, 0, strpos($duration, "H"));
	$duration = substr($duration, strpos($duration, "H")+1);
	}
	if (strpos($duration, "M") > 0)
	{
	$m = substr($duration, 0, strpos($duration, "M"));
	$duration = substr($duration, strpos($duration, "M")+1);
	}
	if (strpos($duration, "S") > 0)
	{
	$s = substr($duration, 0, strpos($duration, "S"));
	$duration = substr($duration, strpos($duration, "S")+1);
	}
	
	$duration=$d*24*60*60+$h*60*60+$m*60+$s;
	$list[$i][6]=$duration;
	
	
}
for ($x = 1; $x < count($list); $x++) {
for ($i = 1; $i < count($list); $i++) {

if ($list[$i][6] < $list[$i-1][6])
{
$s1=$list[$i-1][1];
$s2=$list[$i-1][2];
$s3=$list[$i-1][3];
$s4=$list[$i-1][4];
$s5=$list[$i-1][5];
$s6=$list[$i-1][6];
$list[$i-1][1]=$list[$i][1];
$list[$i-1][2]=$list[$i][2];
$list[$i-1][3]=$list[$i][3];
$list[$i-1][4]=$list[$i][4];
$list[$i-1][5]=$list[$i][5];
$list[$i-1][6]=$list[$i][6];
$list[$i][1]=$s1;
$list[$i][2]=$s2;
$list[$i][3]=$s3;
$list[$i][4]=$s4;
$list[$i][5]=$s5;
$list[$i][6]=$s6;

}
}
}
echo "<table>";
echo "<tr><td>Node</td><td>Channel</td><td>Callsign</td><td>Location</td><td>Keyed</td><td>Last Key/Unkey</td></tr>";

for ($i = 0; $i < count($list); $i++) {
$durationD = intval($list[$i][6]/(24*60*60));
$durationH = intval(($list[$i][6]-$durationD*24*60*60)/(60*60));
$durationM = intval(($list[$i][6]-$durationD*24*60*60-$durationH*60*60)/(60));
$durationS = intval(($list[$i][6]-$durationD*24*60*60-$durationH*60*60-$durationM*60));
$duration ="";
if ($durationD > 0) {$duration = $durationD."D ".$durationH."H ".$durationM."M ".$durationS."S";}else{
if ($durationH > 0) {$duration = $durationH."H ".$durationM."M ".$durationS."S";}else{
if ($durationM > 0) {$duration = $durationM."M ".$durationS."S";}else{$duration = $durationS."S";}}}


echo "<tr><td>".$list[$i][1]."</td><td>".$list[$i][2]."</td><td>".$list[$i][3]."</td><td>".$list[$i][4]."</td><td>".$list[$i][5]."</td><td>".$duration."</td></tr>";
}
echo "<table>";



?>

----


73 de DL1FLO


> Am 09.08.2015 um 04:02 schrieb Skyler F <electricity440 at gmail.com>:
> 
> I like the feature on stats.allstarlink.org which shows the time since last unkey, but I wish there was a way to sort it, it would be really nice if I could find all of the nodes that are currently talking so I could connect in if I want to find someone to talk to or do a demonstration etc.
> 
> First, has anyone done such a thing, where you grab the last unkey from the stats.allstarlink and show all of the nodes that have had traffic sorted by last unkey? 
> 
> Second, if I wanted to do it, what programming language would I have to learn to script it for my ham radio website and how hard would it be? 
> 
> Thanks
> Skyler KDØWHB
> _______________________________________________
> App_rpt-users mailing list
> App_rpt-users at ohnosec.org
> http://ohnosec.org/cgi-bin/mailman/listinfo/app_rpt-users
> 
> To unsubscribe from this list please visit http://ohnosec.org/cgi-bin/mailman/listinfo/app_rpt-users and scroll down to the bottom of the page. Enter your email address and press the "Unsubscribe or edit options button"
> You do not need a password to unsubscribe, you can do it via email confirmation. If you have trouble unsubscribing, please send a message to the list detailing the problem.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.keekles.org/pipermail/app_rpt-users/attachments/20150809/fecc8a75/attachment.html>


More information about the App_rpt-users mailing list