<subtitle>IP Locations of Diaspora pods on podupti.me</subtitle>
<link href="http://podupti.me/"/>
...
...
@@ -25,7 +23,7 @@ EOF;
$numrows=pg_num_rows($result);
while($row=pg_fetch_array($result)){
$pod_name=htmlentities($row['name'],ENT_QUOTES);
$tip=sprintf(
$summary=sprintf(
'This pod %1$s has been watched for %2$s months and its average ping time is %3$s with uptime of %4$s%% this month and was last checked on %5$s. On a score of 100 this pod is a %6$s right now',
$sql='SELECT id,domain,status,secure,score,userrating,adminrating,city,state,country,lat,long,ip,ipv6,pingdomurl,monthsmonitored,uptimelast7,responsetimelast7,local_posts,comment_counts,dateCreated,dateUpdated,dateLaststats,hidden FROM pods';
$result=pg_query($dbh,$sql);
$result||die('Error in SQL query: '.pg_last_error());
$numrows=pg_num_rows($result);
//json output, thx Vipul A M for fixing this
header('Content-type: application/json');
$rows=array_values(pg_fetch_all($result));
$obj->podcount=$numrows;
$obj->pods=$rows;
if($_GET['method']=='jsonp'){
$numrows=pg_num_rows($result);
$rows=array_values(pg_fetch_all($result));
$obj=[
'podcount'=>$numrows,
'pods'=>$rows,
];
if($_GET['method']==='jsonp'){
print$_GET['callback'].'('.json_encode($obj).')';
}else{
printjson_encode($obj);
...
...
@@ -78,23 +75,17 @@ EOF;
$numrows=pg_num_rows($result);
while($row=pg_fetch_array($result)){
if($row['status']=='up'){
$status='Online';
}else{
$status='Offline';
}
if($row['secure']=='true'){
$method='https://';
$class='green';
}else{
$method='http://';
$class='red';
}
echo$row['domain'].' Up '.$row['uptimelast7'].'% This Month - Located in: '.$row['country'];
"\n".'This pod %1$s has been watched for %2$s months and its average ping time is %3$s with uptime of %4$s%% this month and was last checked on %5$s. On a score of -20 to +20 this pod is a %6$s right now',
echo'<td class="'.$classver.'"><div title="'.$pre.' codename: '.$row['longversion'].' master version is: '.$row['masterversion'].'" class="tipsy">'.$version.'</div></td>';
$sql="SELECT * FROM pods WHERE adminrating <> -1 AND hidden <> 'yes' AND uptimelast7 > 95 AND masterversion = shortversion AND signup = 1 ORDER BY RANDOM() LIMIT 1";
$result=pg_query($dbh,$sql);
$result||die('Error in SQL query1: '.pg_last_error());
$result||die('Error in SQL query: '.pg_last_error());
echo'<td data-toggle="tooltip" data-placement="bottom" title="active six months: '.$row['active_users_halfyear'].', active one month: '.$row['active_users_monthly'].'">'.$row['active_users_halfyear'].'</td>';
$tip.="\n This {$row['softwarename']} pod {$pod_name} has been watched for {$row['monthsmonitored']} months with an uptime of {$row['uptimelast7']}% this month and a response time average today of {$row['responsetimelast7']}ms was last checked on {$row['dateupdated']}. ";
$tip.="On a scale of 100 this pod is a {$row['score']} right now";