<summary>Location {$row['city']}, {$row['state']}<![CDATA[<br/>]]>Status {$row['status']}<![CDATA[<br/>]]>Uptime last 7 days {$row['uptimelast7']}<![CDATA[<br/>]]>Response Time {$row['responsetimelast7']}<![CDATA[<br/>]]>Last Git Update {$row['hgitdate']}<![CDATA[<br/>]]>Listed for {$row['monthsmonitored']} months<![CDATA[<br/>]]>Pingdom URL <![CDATA[<A href="{$row['pingdomurl']}">{$row['pingdomurl']}</a>]]></summary>
* This file is licensed under the Affero General Public License version 3 or later.
* See the COPYRIGHT file.
*/
EOF;
}
echo"</feed>";
if($_GET['key']!="4r45tg"){
exit;
}
require_once'db/config.inc.php';
require_once'db/db.class.php';
$dbConnection=DB::connectDB();
if(!$dbConnection){
die("Error in connection: ".$dbConnection->errorInfo()[2]);
}
elseif($_GET['format']=="json"){
$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);
}
if(isset($_GET['format'])){
if($_GET['format']=="georss"){
echo'
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"
xmlns:georss="http://www.georss.org/georss">
<title>Diaspora Pods</title>
<subtitle>IP Locations of Diaspora pods on podupti.me</subtitle>
<link href="http://podupti.me/"/>
';
$sql="SELECT * FROM pods WHERE hidden <> 'yes'";
$result=$dbConnection->query($sql);
if(!$result){
die("Error in SQL query: ".$dbConnection->errorInfo()[2]);
}
foreach($result->fetchAll()as$row){
if($row["secure"]=="true"){
$method="https://";
}else{
$method="http://";
}
echo'
<entry>
<title>{'.$method.'}{'.$row['domain'].'}</title>
<link href="{'.$method.'}{'.$row['domain'].'}"/>
<id>urn:{'.$row['domain'].'}</id>
<summary>Location {'.$row['city'].'}, {'.$row['state'].'}<![CDATA[<br/>]]>Status {'.$row['status'].'}<![CDATA[<br/>]]>Uptime last 7 days {'.$row['uptimelast7'].'}<![CDATA[<br/>]]>Response Time {'.$row['responsetimelast7'].'}<![CDATA[<br/>]]>Last Git Update {'.$row['hgitdate'].'}<![CDATA[<br/>]]>Listed for {'.$row['monthsmonitored'].'} months<![CDATA[<br/>]]>Pingdom URL <![CDATA[<A href="{'.$row['pingdomurl'].'}">{'.$row['pingdomurl'].'}</a>]]></summary>
$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=$dbConnection->query($sql);
if(!$result){
die("Error in SQL query: ".$dbConnection->errorInfo()[2]);
<!-- /* 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');
if(!$_POST['url']){
echo"no url given";
die;
}
if(!$_POST['email']){
echo"no email given";
die;
}
if(!$_POST['domain']){
echo"no pod domain given";
die;
}
if(!$_POST['url']){
echo"no API key for your stats";
die;
}
if(strlen($_POST['url'])<14){
echo"API key bad needs to be like m58978-80abdb799f6ccf15e3e3787ee";
die;
}
/**
* Copyright (c) 2011, David Morley.
* This file is licensed under the Affero General Public License version 3 or later.
die("Error in connection: ".$dbConnection->errorInfo()[2]);
}
$sql="SELECT domain,pingdomurl FROM pods";
echo"Data successfully inserted! Your pod will be reviewed and live on the list soon! You will get a support ticket, no need to do anything if your pod is listed in the next few hours.";
pg_free_result($result);
pg_close($dbh);
}else{
echo"Could not validate your pod on http or https, check your setup!";
$result=$dbConnection->query($sql);
if(!$result){
die("Error in SQL query: ".$dbConnection->errorInfo()[2]);
echo"Data successfully inserted! Your pod will be reviewed and live on the list soon! You will get a support ticket, no need to do anything if your pod is listed in the next few hours.";
}else{
echo"Could not validate your pod on http or https, check your setup!";
<!-- /* Copyright (c) 2011, David Morley. This file is licensed under the Affero General Public License version 3 or later. See the COPYRIGHT file. */ -->
<tableid="myTable"class="tablesorter"width="98%">
<?php
/**
* Copyright (c) 2011, David Morley.
* This file is licensed under the Affero General Public License version 3 or later.
<thwidth="220px">Diaspora Pod<aclass="tipsy"title="A pod is a site for you to set up your account.">?</a></th>
<thstyle="width:220px">Diaspora Pod<aclass="tipsy"title="A pod is a site for you to set up your account.">?</a></th>
<th>Live Status<aclass="tipsy"title="Up or Down according to Pingdom">?</a></th>
<th>Last Code Pull<aclass="tipsy"title="Because the alpha is updated everyday pods with old software will not work correcly with pods with new software. This is the date the p
od last updated from the main Diaspora code.">?</a></th>
...
...
@@ -16,44 +22,65 @@ od last updated from the main Diaspora code.">?</a></th>
if($row["secure"]=="true"){$method="https://";$class="green";$tip="This pod uses SSL encryption for traffic.";}else{$method="http://";$class="red";$tip="This pod does not offer SSL";}