Commit 0b0dc5a7 authored by David Morley's avatar David Morley

add ip date points as such and expose to json api (json still wrong)

parent c5898f70
......@@ -26,6 +26,13 @@ echo '"pods": [';
echo '"url":"'.$method.$row["domain"].'",';
echo '"email":"private",';
echo '"whois":"'.$method.$row["whois"].'",';
echo '"city":"'.$method.$row["city"].'",';
echo '"state":"'.$method.$row["state"].'",';
echo '"country":"'.$method.$row["country"].'",';
echo '"latutude":"'.$method.$row["lat"].'",';
echo '"longitude":"'.$method.$row["long"].'",';
echo '"postalcode":"'.$method.$row["postalcode"].'",';
echo '"connection":"'.$method.$row["connection"].'",';
echo '"SSL Valid":"'.$method.$row["sslvalid"].'",';
echo '"secure":"'.$method.$row["secure"].'",';
echo '"status":"'.$method.$row["status"].'",';
......
......@@ -163,6 +163,14 @@ $ipdata = "Country: ".$obj->{'country'}."\n";
$whois = "Country: ".$obj->{'country'}." City: ".$obj->{'city'}."\n Postal Code:".$obj->{'postal_code'}." Lat:".$obj->{'latitude'}." Long:".$obj->{'longitude'}." Connection:".$obj->{'conn_speed'};
$country=$obj->{'country'};
$city=$obj->{'city'};
$state=$obj->{'region'};
$postalcode=$obj->{'postal_code'};
$lat=$obj->{'latitude'};
$long=$obj->{'longitude'};
$connection=$obj->{'conn_speed'};
//curl the pingdom page
$ping = curl_init();
$thismonth = "/".date("Y")."/".date("m");
......@@ -227,7 +235,7 @@ else {$live="error";}
//sql it
$timenow = date('Y-m-d H:i:s');
$sql = "UPDATE pods SET Hgitdate='$gitdate', Hencoding='$encoding', secure='$secure', hidden='$hidden', Hruntime='$runtime', Hgitref='$gitrev', ip='$ipnum', ipv6='$ipv6', monthsmonitored='$months', uptimelast7='$uptime', status='$live', dateLaststats='$pingdomdate', dateUpdated='$timenow', responsetimelast7='$responsetime', score='$score', adminrating='$adminrating', country='$ipdata', whois='$whois', userrating='$userrating' WHERE domain='$domain'";
$sql = "UPDATE pods SET Hgitdate='$gitdate', Hencoding='$encoding', secure='$secure', hidden='$hidden', Hruntime='$runtime', Hgitref='$gitrev', ip='$ipnum', ipv6='$ipv6', monthsmonitored='$months', uptimelast7='$uptime', status='$live', dateLaststats='$pingdomdate', dateUpdated='$timenow', responsetimelast7='$responsetime', score='$score', adminrating='$adminrating', country='$country', city='$city', state='$state', lat='$lat', long='$long', postalcode='$postalcode', connection='$connection', whois='$whois', userrating='$userrating' WHERE domain='$domain'";
$result = pg_query($dbh, $sql);
if (!$result) {
die("Error in SQL query: " . pg_last_error());
......
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