Commit 576755ef authored by dmorley's avatar dmorley

deal with dupe lat/long

parent 01c2f69f
......@@ -28,7 +28,7 @@ echo <<<EOF
<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>
<summary>Location {$row['country']}</summary>
<georss:point>{$row['lat']} {$row['long']}</georss:point>
<georss:featureName>{$row['domain']}</georss:featureName>
</entry>
......
body {
width: 100%;
margin: 0;
padding: 0;
}
.page-header {
display:none;
}
.adsense {
display:none;
}
.sidebar {
float:none !important;
width:100% !important;
visibility:hidden !important;
width:1px !important;
height:1px !important;
}
.content {
margin-left:1px !important;
}
\ No newline at end of file
#margin-left:1px !important;
}
......@@ -19,6 +19,8 @@
echo "Response Time: " . $row["responsetimelast7"] . "<br>";
echo "User Rating: ". $row["userrating"] . "<br>";
echo "Server Location: ". $row["country"] . "<br>";
echo "Latitude: ". $row["lat"] . "<br>";
echo "Longitude: ". $row["long"] . "<br>";
}
pg_free_result($result);
pg_close($dbh);
......
<?php
$debug = 1;//isset($_GET['debug'])?1:0;
//if ($_GET['debug'] == 1) {$debug =1;}
$debug = isset($_GET['debug'])?1:0;
$debug=1;
//$debug = isset($argv[1])?1:0;
//* Copyright (c) 2011, David Morley. This file is licensed under the Affero General Public License version 3 or later. See the COPYRIGHT file. */
include('config.php');
......@@ -88,11 +88,16 @@ unset($active_users_halfyear);
unset($active_users_monthly);
unset($local_posts);
unset($registrations_open);
unset($dver);
unset($dverr);
unset($xdver);
$chss = curl_init();
curl_setopt($chss, CURLOPT_URL, "https://".$domain."/statistics.json");
curl_setopt($chss, CURLOPT_POST, 0);
curl_setopt($chss, CURLOPT_HEADER, 1);
curl_setopt($chss, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($chss, CURLOPT_TIMEOUT, 5);
curl_setopt($chss, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($chss, CURLOPT_NOBODY, 0);
$outputssl = curl_exec($chss);
......@@ -103,6 +108,7 @@ unset($registrations_open);
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_NOBODY, 0);
$output = curl_exec($ch);
......@@ -134,7 +140,7 @@ if ($jsonssl->registrations_open === true) {$registrations_open=1;}
$xdver = isset($jsonssl->version)?$jsonssl->version:0;
$dverr = split("-",trim($xdver));
$dver = $dverr[0];
if ($debug) {echo "Version code: ".$dver."<br>";}
if ($debug) {echo "(s)Version code: ".$dver."<br>";}
if (!$dver) {$score = $score-2;}
$name = isset($jsonssl->name)?$jsonssl->name:"null";
$total_users = isset($jsonssl->total_users)?$jsonssl->total_users:0;
......@@ -172,6 +178,8 @@ $local_posts = isset($jsonssl->local_posts)?$jsonssl->local_posts:0;
} else {
$secure="false";
$score = $score - 1;
$dver =0;
$dverr=0;
//$hidden="yes";
//no diaspora cookie on either, lets set this one as hidden and notify someone its not really a pod
//could also be a ssl pod with a bad cert, I think its ok to call that a dead pod now
......@@ -200,24 +208,26 @@ $ipv6="no";
} else {
$ipv6="yes";
}
//curl ip
//require_once "Net/GeoIP.php";
//$geoip = Net_GeoIP::getInstance("GeoLiteCity.dat");
try {
$location = geoip_record_by_name($ipnum); //$geoip->lookupLocation($ipnum);
if ($debug) {echo "GEOIP: ".$location."<br>";}
} catch (Exception $e) {
// Handle exception
}
$location = geoip_record_by_name($ipnum);
if ($location) {
$ipdata = "Country: ".$location["country_name"]."\n";
$whois = "Country: ".$location["country_name"]."\n Lat:".$location["latitude"]." Long:".$location["longitude"];
$country=$location["country_name"];
$country=$location["country_code"];
$city= isset($location->city)?iconv("UTF-8", "UTF-8//IGNORE", $location->city):null;
$state="";
$months=0;
$uptime=0;
$lat=$location["latitude"];
$long=$location["longitude"];
//if lat and long are just a generic country with no detail lets make some tail up or openmap just stacks them all on top another
if (strlen($lat) < 4) {
$lat = $lat + (rand(1, 15) / 10);
}
if (strlen($long) < 4) {
$long = $long + (rand(1, 15) / 10);
}
}
echo $ipnum;
$connection="";
$pingdomdate = date('Y-m-d H:i:s');
if (strpos($row[$i]['pingdomurl'], "pingdom.com")) {
......
......@@ -19,7 +19,7 @@ $hidden = isset($_GET['hidden'])?$_GET['hidden']:null;
$lastfile = 'db/last.data';
include("vendor/mobiledetect/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">';}
if ($detect->isMobile()) {echo '<link rel="stylesheet" href="css/mobile.css" />';}
?>
</head>
<body>
......
......@@ -51,11 +51,11 @@ $verdiff = str_replace(".", "", $row["masterversion"]) - str_replace('.', '', $
$tip.="\n This pod {$row["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";
echo "<tr><td><div title='$tip' class='tipsy'><a class='$class' target='new' href='". $method . $row["domain"] ."'>" . $method . $row["domain"] . "</a></div></td>";
echo "<tr><td><div title='$tip' class='tipsy'><a class='$class' target='new' href='". $method . $row["domain"] ."'>" . $row["domain"] . "</a></div></td>";
"</div></td>";
if (stristr($row["shortversion"],'head'))
{$version=".dev code";$pre = "This pod runs pre release
{$version=".dev";$pre = "This pod runs pre release
development code";} elseif (!$row["shortversion"])
{$version="0";$pre = "This pod runs
unknown code";}
......
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