<subtitle>IP Locations of Diaspora pods on podupti.me</subtitle>
<link href="http://podupti.me/"/>
EOF;
$sql="SELECT * FROM pods WHERE hidden <> 'yes'";
$result=pg_query($dbh,$sql);
if(!$result){
die("Error in SQL query: ".pg_last_error());
}
$numrows=pg_num_rows($result);
while($row=pg_fetch_array($result)){
$pod_name=htmlentities($row["name"],ENT_QUOTES);
$tip="";
$tip.="\n This pod {$pod_name} has been watched for {$row["monthsmonitored"]} months and its average ping time is {$row["responsetimelast7"]} with uptime of {$row["uptimelast7"]}% this month and was last checked on {$row["dateupdated"]}. ";
$tip.="On a score of -20 to +20 this pod is a {$row["score"]} right now";
$tip.="\n This pod {$pod_name} has been watched for {$row["monthsmonitored"]} months and its average ping time is {$row["responsetimelast7"]} with uptime of {$row["uptimelast7"]}% this month and was last checked on {$row["dateupdated"]}. ";
$tip.="On a score of -20 to +20 this pod is a {$row["score"]} right now";
$sql="SELECT id,domain,status,secure,score,userrating,adminrating,city,state,country,lat,long,ip,ipv6,hgitdate,hgitref,pingdomurl,pingdomlast,monthsmonitored,uptimelast7,responsetimelast7,hruntime,hencoding,dateCreated,dateUpdated,dateLaststats,hidden FROM pods";
$result=pg_query($dbh,$sql);
if(!$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"){
print$_GET['callback'].'('.json_encode($obj).')';
}else{
printjson_encode($obj);
}
$sql="SELECT id,domain,status,secure,score,userrating,adminrating,city,state,country,lat,long,ip,ipv6,hgitdate,hgitref,pingdomurl,pingdomlast,monthsmonitored,uptimelast7,responsetimelast7,hruntime,hencoding,dateCreated,dateUpdated,dateLaststats,hidden FROM pods";
$result=pg_query($dbh,$sql);
if(!$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"){
print$_GET['callback'].'('.json_encode($obj).')';
}else{
printjson_encode($obj);
}
}else{
$i=0;
$sql="SELECT * FROM pods WHERE hidden <> 'yes' ORDER BY uptimelast7 DESC";
<!-- /* Copyright (c) 2011, David Morley. This file is licensed under the Affero General Public License version 3 or later. See the COPYRIGHT file. */ -->
<?php
$valid=0;
include('config.php');
include('../logging.php');
include('config.php');
include('../logging.php');
$log=newLogging();
$log->lfile($log_dir."/add.php.log");
if(!$_POST['url']){
echo"no url given";$log->lwrite('no url given '.$_POST['domain']);
die;
die;
}
if(!$_POST['email']){
echo"no email given";$log->lwrite('no email given '.$_POST['domain']);
die;
die;
}
if(!$_POST['domain']){
echo"no pod domain given";$log->lwrite('no domain given '.$_POST['domain']);
die;
die;
}
if(!$_POST['url']){
echo"no API key for your stats";$log->lwrite('no api given '.$_POST['domain']);
die;
die;
}
if(strlen($_POST['url'])<14){
echo"API key bad needs to be like m58978-80abdb799f6ccf15e3e3787ee";$log->lwrite('api key too short '.$_POST['domain']);
echo"Data successfully inserted! Your pod will be reviewed and live on the list in a few hours!";
echo"Data successfully inserted! Your pod will be reviewed and live on the list in a few hours!";
pg_free_result($result);
pg_free_result($result);
pg_close($dbh);
pg_close($dbh);
}else{
echo"Could not validate your pod on http or https, check your setup!<br>Take a look at <a href='https://".$_POST['domain']."/nodeinfo/1.0'>your /nodeinfo</a>";$log->lwrite('Could not validate your pod on http or https, check your setup! '.$_POST['domain']);
echo"Could not validate your pod on http or https, check your setup!<br>Take a look at <a href='https://".$_POST['domain']."/nodeinfo/1.0'>your /nodeinfo</a>";$log->lwrite('Could not validate your pod on http or https, check your setup! '.$_POST['domain']);
echo"Weight <input type=text size=2 name=weight value=".$row["weight"]."> This lets you weight your pod lower on the list if you have too much trafic coming in, 10 is the norm use lower to move down the list.<br>";
echo"Weight <input type=text size=2 name=weight value=".$row["weight"]."> This lets you weight your pod lower on the list if you have too much trafic coming in, 10 is the norm use lower to move down the list.<br>";