diff --git a/db/add.php b/db/add.php index d827a9519e364192dfd4e6842f306e92301f808c..2b3c7518bfde660197a7bd1d687da77edaadce1f 100644 --- a/db/add.php +++ b/db/add.php @@ -15,11 +15,11 @@ if (!$_POST['domain']){ die; } if (!$_POST['url']){ - echo "no pingdom url for your stats"; + echo "no API key for your stats"; die; } -if (substr_count($_POST['url'], '/') != 4){ - echo "pingdom url bad, needs to look like http://stats.pingdom.com/xxxxxxxxxxx/xxxxxx"; +if (strlen($_POST['url']) < 14){ + echo "API key bad needs to be like m58978-80abdb799f6ccf15e3e3787ee"; die; } @@ -37,7 +37,7 @@ if ($row["domain"] == $_POST['domain']) { echo "domain already exists";die; } if ($row["pingdomurl"] == $_POST['url']) { -echo "pingdom report already exists";die; +echo "API key already exists";die; } } diff --git a/db/pull.php b/db/pull.php index 637a117f78bb103de5b5d6dbe0a221bf65fc5db9..b3d5472f5118801847a98ac240aca439a9e3fa12 100644 --- a/db/pull.php +++ b/db/pull.php @@ -102,6 +102,7 @@ unset($adminratingavg); curl_setopt($ch, CURLOPT_NOBODY, 1); $output = curl_exec($ch); curl_close($ch); +if ($debug) {print $output;} if ($debug) {print $outputssl;} if (stristr($outputssl, '_diaspora_session')) { //parse header data @@ -164,14 +165,15 @@ if ($secure == "true") {$sorno = "s";} else {$sorno- "";} curl_setopt($chksup, CURLOPT_NOBODY, 1); $outputchksup = curl_exec($chksup); curl_close($chksup); +if ($debug) {print $outputchksup;} preg_match('/Status:(.*?)\n/',$outputchksup,$xsignupon); $signupon = isset($xsignupon[1])?trim($xsignupon[1]):null; $signupon = substr($signupon, 0, 3); if ($signupon == "200") {$signup = 1;} else {$signup = 0;} -if ($debug) {echo "Signup Open: ".$signup."
";} +if ($debug) {echo "
Signup Open: ".$signup."
";} -if ($debug) {echo "SSL: ".$secure."
";} +if ($debug) {echo "
SSL: ".$secure."
";} //if (!$gitdate) { //if a pod is not displaying the git header data its really really really old lets lower your score //$hidden="yes"; @@ -236,7 +238,7 @@ if (strpos($row[$i]['pingdomurl'], "pingdom.com")) { $pingdom = curl_exec($ping); $info = curl_getinfo($ping); curl_close($ping); -if ($debug) {echo "Pingdom code: ".$info['http_code']."
";} +if ($debug) {echo "
Pingdom code: ".$info['http_code']."
";} if ($info['http_code'] == 200) { //response time @@ -249,7 +251,7 @@ preg_match_all('/"historySelect">\s*(.*?)\s*<\/select/is',$pingdom,$matchhistory $implodemonths = implode(" ", $matchhistory[1]); preg_match_all('/Uptime this month<\/h3>\s*

(.*?)%";} +if ($debug) {echo "
Score out of 20: ".$score."
";} if (!$debug) {echo "Success";} //end foreach -sleep($sleep); } } pg_free_result($result); diff --git a/db/pull.sh b/db/pull.sh index 6d72ecbe00ba577748d304449fd6fe0f80a1df9f..230d6a552229036365efbd0edc08888e029984bc 100755 --- a/db/pull.sh +++ b/db/pull.sh @@ -6,7 +6,7 @@ else echo "Checking for internet"; fi -$WGET -d --tries=10 --timeout=15 http://www.google.com -O /tmp/index.google +$WGET -q --tries=10 --timeout=15 http://www.google.com -O /tmp/index.google # &> /dev/null sleep 2 @@ -17,8 +17,8 @@ exit; else echo "Pulling in new pod data"; cd /var/www/podup/db - php5 pull.php - touch last.data + php5 pull.php debug=1 + touch last.data php5 backup.php rm /tmp/index.google fi diff --git a/index.php b/index.php index d2b05cc2b31397548d27dee89bedf5621075d6be..ccccc20f0601c3e4d8b39cbce5f6fefe31d34daf 100644 --- a/index.php +++ b/index.php @@ -96,12 +96,10 @@ s1.parentNode.insertBefore(s, s1);