Commit a5041b6a authored by root's avatar root

some fix, reorder, show last pull datetime, pods with no stats loose score value now

parent bb73da93
......@@ -54,7 +54,7 @@ elseif ($_GET['format'] == "json") {
print json_encode($obj);
} else {
$i=0;
$sql = "SELECT * FROM pods WHERE hidden <> 'yes' ORDER BY uptimelast7 DESC";
$sql = "SELECT * FROM pods WHERE hidden <> 'yes' ORDER BY uptimelast7 ASC";
$result = pg_query($dbh, $sql);
if (!$result) {
die("Error in SQL query: " . pg_last_error());
......
......@@ -203,7 +203,7 @@ if (strpos($row[$i]['pingdomurl'], "pingdom.com")) {
curl_setopt($ping, CURLOPT_FOLLOWLOCATION, true);
$pingdom = curl_exec($ping);
curl_close($ping);
if ($debug) {echo "Pingdom: ".$pingdom."<br>";}
//response time
preg_match_all('/<h3>Avg. resp. time this month<\/h3>
<p class="large">(.*?)</',$pingdom,$matcheach);
......@@ -234,7 +234,7 @@ $pingdomdate = date('Y-m-d H:i:s');
if (strpos($pingdom,"class=\"up\"")) { $live="up"; }
elseif (strpos($pingdom,"class=\"down\"")) { $live="down"; }
elseif (strpos($pingdom,"class=\"paused\"")) { $live="paused";}
else {$live="error";}
else {$live="error";$score=$score-2;}
} else {
//do uptimerobot API instead
$ping = curl_init();
......@@ -277,7 +277,7 @@ domain='$domain'";
}
if ($debug) {echo "Score out of 20: ".$score."<br>";}
if (!$debug) {echo "Success";}
//end foreach
sleep($sleep);
......
cd /var/www/podup/db
php5 pull.php
touch last.data
......@@ -15,6 +15,7 @@
<link rel="stylesheet" href="http://c807316.r16.cf2.rackcdn.com/facebox.css" />
<?php
$lastfile = 'db/last.data';
include("vendor/Mobile_Detect.php");
$detect = new Mobile_Detect();
if ($detect->isMobile()) {echo '<link rel="stylesheet" href="http://c807316.r16.cf2.rackcdn.com/mobile.css" /><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">';}
......@@ -89,6 +90,7 @@ src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
Pod Host? <u style="cursor: pointer; cursor: hand;">Click here</u> to add/manage your listing.<br>
</div>
<div id="info">
Data last refreshed at: <?php echo date("F d Y H:i:s.", filemtime($lastfile)) ?> Pacific Time<br>
Poduptime is run by <a href="https://diasp.org/u/davidmorley" target=_new>David Morley</a> and is open source on <a href="https://github.com/diasporg/Poduptime">GitHub</a><br>
I also run the pods <a href="https://diasp.org/?2" target=_new>diasp.org</a> and the <a href="http://dia.so" target=_new>dia.so</a> site.<br>
Some pods are <a href="http://podupti.me/?hidden=true">Hidden</a> That have too many issues.<br><br>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment