",$magnitude[$item],"";}
+
+ echo ("
\n");
+
+ echo ("
\n");
+ echo ("");
+
+ //Title
+ if ($eqdist[$item]<1300) {
+ echo "
*Regional ".$time[$item]."
";
+ echo $eqtitle[$item];
+ }
+ else {
+ echo "
",$time[$item] ,"
";
+ echo $eqtitle[$item];
+ }
+
+ echo ("
");
+ $eqclose=200; //This is km
+ if ($windunit == 'mph') {
+ if ($eqdist[$item]<$eqclose) {
+ echo "
",round($eqdist[$item] * 0.621371) ." Miles from
$stationlocation";
+ } else {
+ echo round($eqdist[$item] * 0.621371) ." Miles from
$stationlocation";
+ }
+ }
+ else { //if ($windunit == 'km/h') { -- No reason to check this
+ if ($eqdist[$item]<$eqclose) {
+ echo "
",round($eqdist[$item]) ." Km from
$stationlocation";
+ } else {
+ echo round($eqdist[$item]) ." Km from
$stationlocation" ;
+ }
+ }
+ echo "";
+
+ echo ("
\n");
+ echo ("\n");
+}
+?>
@@ -76,11 +136,11 @@
}
- .weather34chart-btn.close:after,.weather34chart-btn.close:before{color:#ccc;position:absolute;font-size:14px;font-family:Arial,Helvetica,sans-serif;font-weight:600}.weather34browser-header{flex-basis:auto;height:35px;background:#ebebeb;background:0;border-bottom:0;display:flex;margin-top:-20px;width:100%;-webkit-border-top-left-radius:5px;-webkit-border-top-right-radius:5px;-moz-border-radius-topleft:5px;-moz-border-radius-topright:5px;border-top-left-radius:5px;border-top-right-radius:5px}.weather34browser-footer{flex-basis:auto;height:35px;background:#ebebeb;background:rgba(56,56,60,1);border-bottom:0;display:flex;bottom:-20px;width:97.4%;-webkit-border-bottom-right-radius:5px;-webkit-border-bottom-left-radius:5px;-moz-border-radius-bottomright:5px;-moz-border-radius-bottomleft:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px}.weather34chart-btns{position:absolute;height:35px;display:inline-block;padding:0 10px;line-height:38px;width:55px;flex-basis:auto;top:5px}.weather34chart-btn{width:14px;height:14px;border:1px solid rgba(0,0,0,.15);border-radius:6px;display:inline-block;margin:1px}.weather34chart-btn.close{background-color: rgba(255, 124, 57, 1.000)}.weather34chart-btn.close:before{content:"x";margin-top:-14px;margin-left:2px}.weather34chart-btn.close:after{content:"close window";margin-top:-13px;margin-left:15px;width:300px}a{color:#aaa;text-decoration:none}
+.weather34chart-btn.close:after,.weather34chart-btn.close:before{color:#ccc;position:absolute;font-size:14px;font-family:Arial,Helvetica,sans-serif;font-weight:600}.weather34browser-header{flex-basis:auto;height:35px;background:#ebebeb;background:0;border-bottom:0;display:flex;margin-top:-20px;width:100%;-webkit-border-top-left-radius:5px;-webkit-border-top-right-radius:5px;-moz-border-radius-topleft:5px;-moz-border-radius-topright:5px;border-top-left-radius:5px;border-top-right-radius:5px}.weather34browser-footer{flex-basis:auto;height:35px;background:#ebebeb;background:rgba(56,56,60,1);border-bottom:0;display:flex;bottom:-20px;width:97.4%;-webkit-border-bottom-right-radius:5px;-webkit-border-bottom-left-radius:5px;-moz-border-radius-bottomright:5px;-moz-border-radius-bottomleft:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px}.weather34chart-btns{position:absolute;height:35px;display:inline-block;padding:0 10px;line-height:38px;width:55px;flex-basis:auto;top:5px}.weather34chart-btn{width:14px;height:14px;border:1px solid rgba(0,0,0,.15);border-radius:6px;display:inline-block;margin:1px}.weather34chart-btn.close{background-color: rgba(255, 124, 57, 1.000)}.weather34chart-btn.close:before{content:"x";margin-top:-14px;margin-left:2px}.weather34chart-btn.close:after{content:"close window";margin-top:-13px;margin-left:15px;width:300px}a{color:#aaa;text-decoration:none}
.weather34darkbrowser{position:relative;background:0;width:100%;max-height:30px;margin:auto;margin-top:-15px;margin-left:0px;border-top-left-radius:5px;border-top-right-radius:5px;padding-top:45px;background-image:radial-gradient(circle,#EB7061 6px,transparent 8px),radial-gradient(circle,#F5D160 6px,transparent 8px),radial-gradient(circle,#81D982 6px,transparent 8px),radial-gradient(circle,rgba(97,106,114,1) 2px,transparent 2px),radial-gradient(circle,rgba(97,106,114,1) 2px,transparent 2px),radial-gradient(circle,rgba(97,106,114,1) 2px,transparent 2px),linear-gradient(to bottom,rgba(59,60,63,0.4) 40px,transparent 0);background-position:left top,left top,left top,right top,right top,right top,0 0;background-size:50px 45px,90px 45px,130px 45px,50px 30px,50px 45px,50px 60px,100%;background-repeat:no-repeat,no-repeat}.weather34darkbrowser[url]:after{content:attr(url);color:#aaa;font-size:10px;position:absolute;left:0;right:0;top:0;padding:4px 15px;margin:11px 50px 0 90px;border-radius:3px;background:rgba(97, 106, 114, 0.3);height:20px;box-sizing:border-box}
blue{color:#01a4b4}orange{color:#009bb4}green{color:#aaa}red{color:#f37867}red6{color:#d65b4a}value{color:#fff}yellow{color:#CC0}purple{color:#916392}
-smalluvunit{font-size:.6rem;font-family:Arial,Helvetica,system;}
+//smalluvunit{font-size:.6rem;font-family:Arial,Helvetica,system;}
smallmagunit{font-size:.55rem;font-family:Arial,Helvetica,system;font-weight:500}
.magcontainer1{left:70px;top:0}
.mag1,.mag1-3,.mag11,.mag4-5,.mag6-8,.mag9-10{
@@ -103,7 +163,7 @@
metricsblue{color:#44a6b5;font-family:"weathertext2",Helvetica, Arial, sans-serif;background:rgba(86, 95, 103, 0.5);-webkit-border-radius:2px;border-radius:2px;align-items:center;justify-content:center;font-size:.9em;left:10px;padding:0 3px 0 3px;}
.w34convertrain{position:relative;font-size:.5em;top:9px;color:#c0c0c0;margin-left:5px}
.hitempy{position:relative;background:rgba(61, 64, 66, 0.5);color:#fff;font-size:12px;width:110px;padding:1px;-webit-border-radius:2px;border-radius:2px;
-margin-top:-48px;margin-left:72px;padding:5px;line-height:10px;font-size:9px}
+margin-top:-40px;margin-left:72px;padding:5px;line-height:10px;font-size:9px}
.actualt{position:relative;left:5px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;border-radius:3px;background:rgba(74, 99, 111, 0.1);
padding:5px;font-family:Arial, Helvetica, sans-serif;width:100px;height:0.8em;font-size:0.8rem;padding-top:2px;color:#aaa;
@@ -114,667 +174,22 @@
.svgimage{background:rgba(0, 155, 171, 1.000);-webit-border-radius:2px;border-radius:2px;}
orange1{color:rgba(255, 131, 47, 1.000);}
-
-
-
-
-   Recent Earthquake
- =7){echo "",$magnitude[0],"";}
- else if($magnitude[0]>=5.8){echo "
",$magnitude[0],"";}
- else if($magnitude[0]>=5){echo "
",$magnitude[0],"";}
- else if($magnitude[0]>=4){echo "
",$magnitude[0],"";}
- else if($magnitude[0]>=2){echo "
",$magnitude[0],"";}
- else if($magnitude[0]<2){echo "
N/A";}
-
- ?>
-
-
-
-
-
-*Regional ".$eventime[0]."
";
- echo $eqtitle[0];
- }
- else if ($magnitude[0]>7) {
- echo "
",$eventime[0] ,"
";
- echo $eqtitle[0] ;
- }
-
-
- else if ($magnitude[0]>5.7) {
- echo "
",$eventime[0] ,"
";
- echo $eqtitle[0] ;
- }
-
-
- else if ($magnitude[0]>5.2) {
- echo "
",$eventime[0] ,"
";
- echo $eqtitle[0] ;
- }
-
- else if ($magnitude[0]>4) {
- echo "
",$eventime[0] ,"
";
- echo $eqtitle[0] ;
- }
-
-
- else if ($magnitude[0]>3) {
- echo "
",$eventime[0] ,"
";
- echo $eqtitle[0] ;
- }
-
- else if ($magnitude[0]>2) {
- echo "
",$eventime[0] ,"
";
- echo $eqtitle[0] ;
- }
-}
-
-?>
- $stationlocation";
- }
-
-else if ($windunit == 'km/h' && $eqdist[0]<700) {
- echo "
",round($eqdist[0]) ." Km from
$stationlocation";
- }
-
-else if ($windunit == 'mph') {
- echo round($eqdist[0] * 0.621371) ." Miles from
$stationlocation";
- } else {
- echo $eqdist[0] ." Km from
$stationlocation" ;
- }
- echo "";
- ?>
-
-
-
-
-
-
-   Recent Earthquake
- =7){echo "",$magnitude[1],"";}
- else if($magnitude[1]>=5.8){echo "
",$magnitude[1],"";}
- else if($magnitude[1]>=5){echo "
",$magnitude[1],"";}
- else if($magnitude[1]>=4){echo "
",$magnitude[1],"";}
- else if($magnitude[1]>=2){echo "
",$magnitude[1],"";}
- else if($magnitude[1]<2){echo "
N/A";}
-
- ?>
-
-
-
-
-
-*Regional ".$eventime[1]."
";
- echo $eqtitle[1];
- }
- else if ($magnitude[1]>7) {
- echo "
",$eventime[1] ,"
";
- echo $eqtitle[1] ;
- }
-
-
- else if ($magnitude[1]>5.7) {
- echo "
",$eventime[1] ,"
";
- echo $eqtitle[1] ;
- }
-
-
- else if ($magnitude[1]>5.2) {
- echo "
",$eventime[1] ,"
";
- echo $eqtitle[1] ;
- }
-
- else if ($magnitude[1]>4) {
- echo "
",$eventime[1] ,"
";
- echo $eqtitle[1] ;
- }
-
-
- else if ($magnitude[1]>3) {
- echo "
",$eventime[1] ,"
";
- echo $eqtitle[0] ;
- }
-
- else if ($magnitude[1]>2) {
- echo "
",$eventime[1] ,"
";
- echo $eqtitle[1] ;
- }
-}
-
-?>
- $stationlocation";
- }
-
-else if ($windunit == 'km/h' && $eqdist[1]<700) {
- echo "
",round($eqdist[1]) ." Km from
$stationlocation";
- }
-
-else if ($windunit == 'mph') {
- echo round($eqdist[1] * 0.621371) ." Miles from
$stationlocation";
- } else {
- echo $eqdist[1] ." Km from
$stationlocation" ;
- }
- echo "";
- ?>
-
-
-
-
-
-
-   Recent Earthquake
- =7){echo "",$magnitude[2],"";}
- else if($magnitude[2]>=5.8){echo "
",$magnitude[2],"";}
- else if($magnitude[2]>=5){echo "
",$magnitude[2],"";}
- else if($magnitude[2]>=4){echo "
",$magnitude[2],"";}
- else if($magnitude[2]>=2){echo "
",$magnitude[2],"";}
- else if($magnitude[2]<2){echo "
N/A";}
-
- ?>
-
-
-
-
-
-*Regional ".$eventime[2]."
";
- echo $eqtitle[2];
- }
- else if ($magnitude[2]>7) {
- echo "
",$eventime[2] ,"
";
- echo $eqtitle[2] ;
- }
-
-
- else if ($magnitude[2]>5.7) {
- echo "
",$eventime[2] ,"
";
- echo $eqtitle[2] ;
- }
-
-
- else if ($magnitude[2]>5.2) {
- echo "
",$eventime[2] ,"
";
- echo $eqtitle[2] ;
- }
-
- else if ($magnitude[2]>4) {
- echo "
",$eventime[2] ,"
";
- echo $eqtitle[2] ;
- }
-
-
- else if ($magnitude[2]>3) {
- echo "
",$eventime[2] ,"
";
- echo $eqtitle[0] ;
- }
-
- else if ($magnitude[2]>2) {
- echo "
",$eventime[2] ,"
";
- echo $eqtitle[2] ;
- }
-}
-
-?>
$stationlocation";
- }
-
-else if ($windunit == 'km/h' && $eqdist[2]<700) {
- echo "
",round($eqdist[2]) ." Km from
$stationlocation";
- }
-
-else if ($windunit == 'mph') {
- echo round($eqdist[2] * 0.621371) ." Miles from
$stationlocation";
+ global $min_eq;
+ if ($min_eq) {
+ echo ("
");
} else {
- echo $eqdist[2] ." Km from
$stationlocation" ;
+ echo ("
");
}
- echo "";
- ?>
-
-
-
-
-
-
-   Recent Earthquake
- =7){echo "",$magnitude[3],"";}
- else if($magnitude[3]>=5.8){echo "
",$magnitude[3],"";}
- else if($magnitude[3]>=5){echo "
",$magnitude[3],"";}
- else if($magnitude[3]>=4){echo "
",$magnitude[3],"";}
- else if($magnitude[3]>=2){echo "
",$magnitude[3],"";}
- else if($magnitude[3]<2){echo "
N/A";}
-
- ?>
-
-
-
-
-
-*Regional ".$eventime[3]."
";
- echo $eqtitle[3];
- }
- else if ($magnitude[3]>7) {
- echo "
",$eventime[3] ,"
";
- echo $eqtitle[3] ;
- }
-
-
- else if ($magnitude[3]>5.7) {
- echo "
",$eventime[3] ,"
";
- echo $eqtitle[3] ;
- }
-
-
- else if ($magnitude[3]>5.2) {
- echo "
",$eventime[3] ,"
";
- echo $eqtitle[3] ;
- }
-
- else if ($magnitude[3]>4) {
- echo "
",$eventime[3] ,"
";
- echo $eqtitle[3] ;
- }
-
-
- else if ($magnitude[3]>3) {
- echo "
",$eventime[3] ,"
";
- echo $eqtitle[3] ;
- }
-
- else if ($magnitude[3]>2) {
- echo "
",$eventime[3] ,"
";
- echo $eqtitle[3] ;
- }
-}
-
-?>
- $stationlocation";
- }
-
-else if ($windunit == 'km/h' && $eqdist[0]<700) {
- echo "
",round($eqdist[3]) ." Km from
$stationlocation";
- }
-
-else if ($windunit == 'mph') {
- echo round($eqdist[3] * 0.621371) ." Miles from
$stationlocation";
- } else {
- echo $eqdist[3] ." Km from
$stationlocation" ;
- }
- echo "";
- ?>
-
-
-
-
-
-
-   Recent Earthquake
- =7){echo "",$magnitude[4],"";}
- else if($magnitude[4]>=5.8){echo "
",$magnitude[4],"";}
- else if($magnitude[4]>=5){echo "
",$magnitude[4],"";}
- else if($magnitude[4]>=4){echo "
",$magnitude[4],"";}
- else if($magnitude[4]>=2){echo "
",$magnitude[4],"";}
- else if($magnitude[4]<2){echo "
N/A";}
-
- ?>
-
-
-
-
-
-*Regional ".$eventime[4]."
";
- echo $eqtitle[4];
- }
- else if ($magnitude[4]>7) {
- echo "
",$eventime[4] ,"
";
- echo $eqtitle[4] ;
- }
-
-
- else if ($magnitude[4]>5.7) {
- echo "
",$eventime[4] ,"
";
- echo $eqtitle[4] ;
- }
-
-
- else if ($magnitude[4]>5.2) {
- echo "
",$eventime[4] ,"
";
- echo $eqtitle[4] ;
- }
-
- else if ($magnitude[4]>4) {
- echo "
",$eventime[4] ,"
";
- echo $eqtitle[4] ;
- }
-
-
- else if ($magnitude[4]>3) {
- echo "
",$eventime[4] ,"
";
- echo $eqtitle[4] ;
- }
-
- else if ($magnitude[4]>2) {
- echo "
",$eventime[4] ,"
";
- echo $eqtitle[4] ;
- }
-}
-
-?>
- $stationlocation";
- }
-
-else if ($windunit == 'km/h' && $eqdist[4]<700) {
- echo "
",round($eqdist[4]) ." Km from
$stationlocation";
- }
-
-else if ($windunit == 'mph') {
- echo round($eqdist[4] * 0.621371) ." Miles from
$stationlocation";
- } else {
- echo $eqdist[4] ." Km from
$stationlocation" ;
- }
- echo "";
- ?>
-
-
-
-
-
-
-   Recent Earthquake
- =7){echo "",$magnitude[5],"";}
- else if($magnitude[5]>=5.8){echo "
",$magnitude[5],"";}
- else if($magnitude[5]>=5){echo "
",$magnitude[5],"";}
- else if($magnitude[5]>=4){echo "
",$magnitude[5],"";}
- else if($magnitude[5]>=2){echo "
",$magnitude[5],"";}
- else if($magnitude[5]<2){echo "
N/A";}
-
- ?>
-
-
-
-
-
-*Regional ".$eventime[5]."
";
- echo $eqtitle[5];
- }
- else if ($magnitude[5]>7) {
- echo "
",$eventime[5] ,"
";
- echo $eqtitle[0] ;
- }
-
-
- else if ($magnitude[5]>5.7) {
- echo "
",$eventime[5] ,"
";
- echo $eqtitle[5] ;
- }
-
-
- else if ($magnitude[5]>5.2) {
- echo "
",$eventime[5] ,"
";
- echo $eqtitle[5] ;
- }
-
- else if ($magnitude[5]>4) {
- echo "
",$eventime[5] ,"
";
- echo $eqtitle[5] ;
- }
-
-
- else if ($magnitude[5]>3) {
- echo "
",$eventime[5] ,"
";
- echo $eqtitle[5] ;
- }
-
- else if ($magnitude[5]>2) {
- echo "
",$eventime[5] ,"
";
- echo $eqtitle[5] ;
- }
-}
-
-?>
- $stationlocation";
- }
-
-else if ($windunit == 'km/h' && $eqdist[5]<700) {
- echo "
",round($eqdist[5]) ." Km from
$stationlocation";
- }
-
-else if ($windunit == 'mph') {
- echo round($eqdist[5] * 0.621371) ." Miles from
$stationlocation";
- } else {
- echo $eqdist[5] ." Km from
$stationlocation" ;
- }
- echo "";
- ?>
-
-
-
-
-
-
-
-   Recent Earthquake
- =7){echo "",$magnitude[6],"";}
- else if($magnitude[6]>=5.8){echo "
",$magnitude[6],"";}
- else if($magnitude[6]>=5){echo "
",$magnitude[6],"";}
- else if($magnitude[6]>=4){echo "
",$magnitude[6],"";}
- else if($magnitude[6]>=2){echo "
",$magnitude[6],"";}
- else if($magnitude[6]<2){echo "
N/A";}
-
- ?>
-
-
-
-
-
-*Regional ".$eventime[6]."
";
- echo $eqtitle[6];
- }
- else if ($magnitude[6]>7) {
- echo "
",$eventime[6] ,"
";
- echo $eqtitle[6] ;
- }
-
-
- else if ($magnitude[6]>5.7) {
- echo "
",$eventime[6] ,"
";
- echo $eqtitle[6] ;
- }
-
-
- else if ($magnitude[6]>5.2) {
- echo "
",$eventime[6] ,"
";
- echo $eqtitle[6] ;
- }
-
- else if ($magnitude[6]>4) {
- echo "
",$eventime[6] ,"
";
- echo $eqtitle[6] ;
- }
-
-
- else if ($magnitude[6]>3) {
- echo "
",$eventime[6] ,"
";
- echo $eqtitle[6] ;
- }
-
- else if ($magnitude[6]>2) {
- echo "
",$eventime[6] ,"
";
- echo $eqtitle[6] ;
- }
-}
-
-?>
- $stationlocation";
- }
-
-else if ($windunit == 'km/h' && $eqdist[6]<700) {
- echo "
",round($eqdist[6]) ." Km from
$stationlocation";
- }
-
-else if ($windunit == 'mph') {
- echo round($eqdist[6] * 0.621371) ." Miles from
$stationlocation";
- } else {
- echo $eqdist[6] ." Km from
$stationlocation" ;
- }
- echo "";
- ?>
-
-
-
-
-
-
-   Recent Earthquake
- =7){echo "",$magnitude[7],"";}
- else if($magnitude[7]>=5.8){echo "
",$magnitude[7],"";}
- else if($magnitude[7]>=5){echo "
",$magnitude[7],"";}
- else if($magnitude[7]>=4){echo "
",$magnitude[7],"";}
- else if($magnitude[7]>=2){echo "
",$magnitude[7],"";}
- else if($magnitude[7]<2){echo "
N/A";}
-
- ?>
-
-
-
-
-
-*Regional ".$eventime[7]."
";
- echo $eqtitle[7];
- }
- else if ($magnitude[7]>7) {
- echo "
",$eventime[7] ,"
";
- echo $eqtitle[7] ;
- }
-
-
- else if ($magnitude[7]>5.7) {
- echo "
",$eventime[7] ,"
";
- echo $eqtitle[7] ;
- }
-
-
- else if ($magnitude[7]>5.2) {
- echo "
",$eventime[7] ,"
";
- echo $eqtitle[7] ;
- }
-
- else if ($magnitude[7]>4) {
- echo "
",$eventime[7] ,"
";
- echo $eqtitle[7] ;
- }
-
-
- else if ($magnitude[7]>3) {
- echo "
",$eventime[7] ,"
";
- echo $eqtitle[7] ;
- }
-
- else if ($magnitude[7]>2) {
- echo "
",$eventime[7] ,"
";
- echo $eqtitle[7] ;
- }
-}
-
-?>
- $stationlocation";
- }
-
-else if ($windunit == 'km/h' && $eqdist[7]<700) {
- echo "
",round($eqdist[7]) ." Km from
$stationlocation";
- }
+?>
-else if ($windunit == 'mph') {
- echo round($eqdist[7] * 0.621371) ." Miles from
$stationlocation";
- } else {
- echo $eqdist[7] ." Km from
$stationlocation" ;
- }
- echo "";
+
+
-
-
-
-
-
  © Information
@@ -783,7 +198,7 @@
-Data © Earthquake-Report.com
+Data © USGS Earthquake GeoJSON Summary Feed
diff --git a/livedata.php b/livedata.php
index d0861c4..d59f3a2 100644
--- a/livedata.php
+++ b/livedata.php
@@ -782,8 +782,10 @@
$weather['rainStartTime'] = 'All Time';
}
-$weather['consoleLowBattery'] = intval($meteobridgeapi[171]); # Console battery, 0 when battery is good, 1 when battery is low
-$weather['stationLowBattery'] = intval($meteobridgeapi[172]); # Station battery, 0 when battery is good, 1 when battery is low
+//$weather['consoleLowBattery'] = intval($meteobridgeapi[171]); # Console battery, 0 when battery is good, 1 when battery is low
+$weather['consoleLowBattery'] = 0;
+//$weather['stationLowBattery'] = intval($meteobridgeapi[172]); # Station battery, 0 when battery is good, 1 when battery is low
+$weather['stationLowBattery'] = 0;
#if (is_numeric($meteobridgeapi[190]){
# $weather['rainStartYearSec'] = $meteobridgeapi[190];
diff --git a/mbdbfiles/stationcron.php b/mbdbfiles/stationcron.php
index faf0419..af6b333 100644
--- a/mbdbfiles/stationcron.php
+++ b/mbdbfiles/stationcron.php
@@ -57,32 +57,32 @@
echo ($_SERVER['HTTP_USER_AGENT']=='meteobridge'?'Please set your Metar API Key in EasyWeatherSetup.php
':"
Please set your Metar API Key in EasyWeatherSetup.php
");
}
-#Update DarkSky
-if ($position6=="forecast3ds.php" || $position6=='forecast3wu.php' || $position6=='forecast3wularge.php' || $position4 == "advisory.php"){
- if ($apikey != "11111111111111") {
- // weather34 darksky curl based
- $url4a = 'https://api.forecast.io/forecast/'.$apikey.'/'.$lat.','.$lon.'?lang='.$language.'&units='.$darkskyunit ;
- $ch4a = curl_init($url4a);
- $filename4a = '../jsondata/darksky.txt';
- $complete_save_loc4a = $filename4a;
- $fp4a = fopen($complete_save_loc4a, 'wb');
- curl_setopt($ch4a, CURLOPT_FILE, $fp4a);
- curl_setopt($ch4a, CURLOPT_HEADER, 0);
- $result = curl_exec($ch4a);
- if ($result) {
- echo ($_SERVER['HTTP_USER_AGENT']=='meteobridge'?'DarkSky updated
':"
DarkSky updated
");
- } else {
- echo ($_SERVER['HTTP_USER_AGENT']=='meteobridge'?'Problem updating DarkSky
':"
Problem updating DarkSky
");
- }
- curl_close($ch4a);
- fclose($fp4a);
- unset($result);
- } else {
- echo ($_SERVER['HTTP_USER_AGENT']=='meteobridge'?'Please set your DarkSky API Key in EasyWeatherSetup.php
':"
Please set your DarkSky API Key in EasyWeatherSetup.php
");
- }
-} else {
- echo ($_SERVER['HTTP_USER_AGENT']=='meteobridge'?'Not set to use DarkSky
':"
Not set to use DarkSky
");
-}
+#Update DarkSky ***** DarkSky is no longer Operational *****
+//if ($position6=="forecast3ds.php" || $position6=='forecast3wu.php' || $position6=='forecast3wularge.php' || $position4 == "advisory.php"){
+// if ($apikey != "11111111111111") {
+// // weather34 darksky curl based
+// $url4a = 'https://api.forecast.io/forecast/'.$apikey.'/'.$lat.','.$lon.'?lang='.$language.'&units='.$darkskyunit ;
+// $ch4a = curl_init($url4a);
+// $filename4a = '../jsondata/darksky.txt';
+// $complete_save_loc4a = $filename4a;
+// $fp4a = fopen($complete_save_loc4a, 'wb');
+// curl_setopt($ch4a, CURLOPT_FILE, $fp4a);
+// curl_setopt($ch4a, CURLOPT_HEADER, 0);
+// $result = curl_exec($ch4a);
+// if ($result) {
+// echo ($_SERVER['HTTP_USER_AGENT']=='meteobridge'?'DarkSky updated
':"
DarkSky updated
");
+// } else {
+// echo ($_SERVER['HTTP_USER_AGENT']=='meteobridge'?'Problem updating DarkSky
':"
Problem updating DarkSky
");
+// }
+// curl_close($ch4a);
+// fclose($fp4a);
+// unset($result);
+// } else {
+// echo ($_SERVER['HTTP_USER_AGENT']=='meteobridge'?'Please set your DarkSky API Key in EasyWeatherSetup.php
':"
Please set your DarkSky API Key in EasyWeatherSetup.php
");
+// }
+//} else {
+// echo ($_SERVER['HTTP_USER_AGENT']=='meteobridge'?'Not set to use DarkSky
':"
Not set to use DarkSky
");
+//}
#Update WU
if ($position6=="forecast3wu.php" || $position6=="forecast3wularge.php"){
@@ -112,7 +112,8 @@
}
// weather34 earthquakes curl based
-$url1 = 'https://earthquake-report.com/feeds/recent-eq?json';
+//$url1 = 'https://earthquake-report.com/feeds/recent-eq?json';
+$url1 = 'https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_week.geojson';
$ch1 = curl_init($url1);
$filename1 = '../jsondata/eqnotification.txt';
$complete_save_loc1 = $filename1;
@@ -130,7 +131,8 @@
unset($result);
//k-index curl based
-$url2a = 'https://services.swpc.noaa.gov/products/geospace/planetary-k-index-dst.json';
+//$url2a = 'https://services.swpc.noaa.gov/products/geospace/planetary-k-index-dst.json';
+$url2a = 'https://services.swpc.noaa.gov/products/noaa-planetary-k-index.json';
$ch2a = curl_init($url2a);
$filename2a = '../jsondata/kindex.txt';
$complete_save_loc2a = $filename2a;
@@ -150,13 +152,15 @@
// weather34 purple air quality curl based
if($purpleairhardware=='yes'){
if ($purpleairID != "11111") {
- $url4 = 'https://www.purpleair.com/json?show='.$purpleairID;
+ $url4 = 'https://api.purpleair.com/v1/sensors/'.$purpleairID;
$ch4 = curl_init($url4);
$filename4 = '../jsondata/purpleair.txt';
$complete_save_loc4 = $filename4;
$fp4 = fopen($complete_save_loc4, 'wb');
curl_setopt($ch4, CURLOPT_FILE, $fp4);
- curl_setopt($ch4, CURLOPT_HEADER, 0);
+ $pahdr = [ "X-API-Key: ".$purpleairapikey ];
+ curl_setopt($ch4, CURLOPT_HTTPHEADER, $pahdr);
+
$result = curl_exec($ch4);
if ($result) {
echo ($_SERVER['HTTP_USER_AGENT']=='meteobridge'?'PurpleAir updated
':"
PurpleAir updated
");
diff --git a/mbdbfiles/stationcroncurl.php b/mbdbfiles/stationcroncurl.php
index 3791ba0..5732bbc 100644
--- a/mbdbfiles/stationcroncurl.php
+++ b/mbdbfiles/stationcroncurl.php
@@ -59,7 +59,8 @@
fclose($fp);
?>
\ No newline at end of file
diff --git a/purpleair.php b/purpleair.php
index 3afb717..8410215 100644
--- a/purpleair.php
+++ b/purpleair.php
@@ -42,14 +42,14 @@ function map($value, $fromLow, $fromHigh, $toLow, $toHigh){
return $tmpValue + $toLow;
}
$json_string = file_get_contents("jsondata/purpleair.txt");
-$parsed_json = json_decode($json_string);
+$parsed_json = json_decode($json_string, true);
//$aqiweather["aqi"] = $parsed_json->{'results'}[1]->{'PM2_5Value'};
-$aqiweather["aqi"] = number_format(pm25_to_aqi(($parsed_json->{'results'}[0]->{'PM2_5Value'} + $parsed_json->{'results'}[1]->{'PM2_5Value'}) / 2),1);
+$aqiweather["aqi"] = number_format(pm25_to_aqi($parsed_json['sensor']['stats']['pm2.5_10minute']),1);
$aqiweather["aqiozone"] = 'N/A';
-$aqiweather["time2"] = $parsed_json->{'results'}[0]->{'LastSeen'};
-$aqiweather["time"] = date("H:i",$aqiweather["time2"]);
-$aqiweather["city"] = $parsed_json->{'results'}[0]->{'ID'};
-$aqiweather["label"] = $parsed_json->{'results'}[0]->{'Label'};
+$aqiweather["time2"] = $parsed_json['sensor']['last_seen'];
+$aqiweather["time"] = date($timeFormat,$aqiweather["time2"]);
+$aqiweather["city"] = $parsed_json['sensor']['name'];
+$aqiweather["label"] = $parsed_json['sensor']['name'];
$a="";if($aqiweather["aqi"]==$a){$aqiweather["aqi"] = "0" ;}
diff --git a/settings1.default.php b/settings1.default.php
index 301c1e9..6a0db4a 100644
--- a/settings1.default.php
+++ b/settings1.default.php
@@ -8,6 +8,7 @@
$id = "ISTANBUL161";
$purpleairID = "11111";
$purpleairhardware = "yes";
+$purpleairapikey = "XXXXX-XXXX-XXXX-XXXX-XXXXXXXX";
$metarapikey ="11111111111111";
$TZ = "Europe/London";
$UTC = "1";