Author Topic: weatherextremes.php FIX  (Read 4413 times)

0 Members and 1 Guest are viewing this topic.

Offline pimohdaimaoh

  • Forecaster
  • *****
  • Posts: 300
  • "Be aware to our nature"
    • PIMOHWEATHER
weatherextremes.php FIX
« on: July 31, 2023, 01:52:27 AM »
Hello Guys,

Maybe some of you that is using the weatherextremes.php having trouble to ogimet showing proper presipitation values, since I have these problem lately I decided to fix the structures from the original creation of Michael (michael@relayweather.com). lately ogimet adds additional layer of cells including max Average temperature and Gust resulting the script trouble reading proper cell location for Precipitation totals.

no further ADO I uploaded the updated script here for weatherextremes.php for you to use, this is already repaired script and the proper value of max precipitation total can now shown correctly. The original script on this still credited to Michael (relayweather.com)

Hope it helps folks
« Last Edit: July 31, 2023, 01:59:56 AM by pimohdaimaoh »

Offline vinesweather

  • Forecaster
  • *****
  • Posts: 342
    • The Vines Weather
Re: weatherextremes.php FIX
« Reply #1 on: October 07, 2023, 12:15:41 AM »
Try as I might I can't seem to get it to work.
https://vinesweather.com/worldextremes.php

Offline pimohdaimaoh

  • Forecaster
  • *****
  • Posts: 300
  • "Be aware to our nature"
    • PIMOHWEATHER
Re: weatherextremes.php FIX
« Reply #2 on: October 08, 2023, 01:50:33 AM »
Well I test it on my Local page it seems working fine with me

I re upload the script, copy and paste this in your php and try to put it in a folder or create a folder for it then put this file there, maybe in your htm folder seems it restricts to download the parsed cache
« Last Edit: October 08, 2023, 01:52:04 AM by pimohdaimaoh »

Offline vinesweather

  • Forecaster
  • *****
  • Posts: 342
    • The Vines Weather
Re: weatherextremes.php FIX
« Reply #3 on: October 08, 2023, 06:20:53 AM »

Offline pimohdaimaoh

  • Forecaster
  • *****
  • Posts: 300
  • "Be aware to our nature"
    • PIMOHWEATHER
Re: weatherextremes.php FIX
« Reply #4 on: October 08, 2023, 12:00:39 PM »
if your webserver php is version 8.1 or 8.0 that might be the problem try to test it on your local if it runs smoothly if oit does it means theres conflict with your PHP version or TRY to lower your PHP to 7.8 then check if it runs ok
« Last Edit: October 09, 2023, 05:10:04 AM by pimohdaimaoh »

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 1368
  • BismarckWeather.net
    • BismarckWeather.net
Re: weatherextremes.php FIX
« Reply #5 on: October 08, 2023, 12:18:20 PM »
I'm running on PHP 8.1 without issues.

https://www.bismarckweather.net/worldextremesrun.php
https://www.BismarckWeather.net
Davis VP2, Cumulus, WeatherDisplay, Blitzortung, Saratoga Scripts, NOAA Stream via PI

Offline hcorrin

  • Senior Contributor
  • ****
  • Posts: 170
    • Ballaugh Weather
Re: weatherextremes.php FIX
« Reply #6 on: October 09, 2023, 04:24:41 AM »
Mine is running php 8.0 https://www.hc-iom.co.uk/WD-AJAX1/worldextremes.php
When vinesweather 2 links do display something they just show 32.0 values and they take a while to show, too me that looks like it’s not getting the data any error logs on the server as to what may be happening
I have noticed that there are a few “http” that may need changing to “https” as the ogimet site is running on https
« Last Edit: October 09, 2023, 04:49:46 AM by hcorrin »

Offline vinesweather

  • Forecaster
  • *****
  • Posts: 342
    • The Vines Weather
Re: weatherextremes.php FIX
« Reply #7 on: October 09, 2023, 06:36:10 AM »
Thanks guys. I've changed all the http to https. Still same errors.
I've attached the log and my worldextremes.php file. Thank you for your help. I'm sure it's something simple, I just cant see it.
« Last Edit: October 09, 2023, 06:37:56 AM by vinesweather »

Offline tmabell

  • Forecaster
  • *****
  • Posts: 415
    • Mishawaka Weather
« Last Edit: October 09, 2023, 07:39:06 AM by tmabell »

Offline hcorrin

  • Senior Contributor
  • ****
  • Posts: 170
    • Ballaugh Weather
Re: weatherextremes.php FIX
« Reply #9 on: October 09, 2023, 03:32:14 PM »
your script works ok on my local sever http://ballaugh.no-ip.biz:59202/WD-AJAX4/worldextremes1.php
so the error log is saying its not getting a stream which suggests the servers are not being allowed access to ogimet.com server
can you access https://www.ogimet.com/index.phtml.en from your browser

Offline BeaumarisWX

  • Senior Member
  • **
  • Posts: 54
    • BeaumarisWX
Re: weatherextremes.php FIX
« Reply #10 on: October 09, 2023, 05:17:47 PM »
Hi,
I gave up on this years ago, not sure if it is Host Server (I am on same Host as vinesweather) issue or Ogimet.
I can view the report on Ogimet in Browser, though script will not download and or cache any data at all.
https://www.ogimet.com/cgi-bin/gsynext?lang=en&state=Austra&rank=10&ano=2023&mes=10&day=09&hora=21&Send=send
Something is blocked somewhere.
Kind regards,
« Last Edit: October 09, 2023, 05:35:23 PM by BeaumarisWX »
Tony Beaumaris, Tasmania (Australia)
CumulusMX GUI : https://beaumaris-weather.com/MXUI/
Saratoga Template : https://beaumaris-weather.com

Offline pimohdaimaoh

  • Forecaster
  • *****
  • Posts: 300
  • "Be aware to our nature"
    • PIMOHWEATHER
Re: weatherextremes.php FIX
« Reply #11 on: October 10, 2023, 02:14:50 AM »
try replacing with this on php script

$siteSource = "http://51.89.234.241/cgi-bin/gsynext?lang=en&state=$country&rank=$stations&ano=$year&mes=$month&day=$day&hora=$hour&Send=send";

if not, maybe this

$siteSource = "http://www.ogimet.com/cgi-bin/gsynext?lang=en&state=$country&rank=$stations&ano=$year&mes=$month&day=$day&hora=$hour&Send=send";


because I suspect that your hosting site preventing it to parse with real website so instead, try OGIMET's IP address maybe it works

Offline BeaumarisWX

  • Senior Member
  • **
  • Posts: 54
    • BeaumarisWX
Re: weatherextremes.php FIX
« Reply #12 on: October 10, 2023, 04:41:59 AM »
Hi cheers. Yeah I tried that when you posted same eons ago. Makes no dif.
As I mentioned I think it may be a server blocked by the other.
Cheers.
Tony Beaumaris, Tasmania (Australia)
CumulusMX GUI : https://beaumaris-weather.com/MXUI/
Saratoga Template : https://beaumaris-weather.com

Offline ConligWX

  • Forecaster
  • *****
  • Posts: 873
  • #conligwx
    • conligwx.org
Re: weatherextremes.php FIX
« Reply #13 on: November 17, 2023, 12:22:55 PM »
Hi cheers. Yeah I tried that when you posted same eons ago. Makes no dif.
As I mentioned I think it may be a server blocked by the other.
Cheers.

Tony,  might be worth tracing the route from your site to see what is block.  I am guessing the block is  probably a firewall rule on ogimet against your the hosting company you use.

anyone else require a worldextremes.php  they can download an updated version here:

https://www.conligwx.org/worldextremes.php?sce=view

https://www.conligwx.org/wxextremes.php  <-viewed in Saratoga Templates.

https://www.conligwx.org/worldextremes.php  - without templates.
Regards Simon
Davis Vantage Pro2 Plus (6162UK) • Daytime FARS • WeatherLink Live • AirLink • PurpleAir PA-II-SD • CumulusMX • ADSB.im • Pi 4 • AirSpy mini • Uputronics Filtered 1090 Preamp


Offline CrondallWeather

  • Crondall Weather
  • Member
  • *
  • Posts: 21
  • Still a classic - like so many of us....
    • Crondall Weather
Re: weatherextremes.php FIX
« Reply #14 on: November 17, 2023, 01:55:34 PM »
Simon,

I too have been struggling to get this script to display properly.

Just downloaded and installed your script exactly as you have it as I'm also in the UK

https://crondallweather.co.uk/worldextremes-new.php?sce=view

And although it executes (fairly slowly) no data is pulled in as you can see from the screenshot.

How do I actually trace to see if it's the Hosting company?

My hosting company is Hostinger - https://www.hostinger.co.uk/

Appreciate any tips / guidance

Many thanks

Neil

« Last Edit: November 17, 2023, 02:01:56 PM by CrondallWeather »

Offline BeaumarisWX

  • Senior Member
  • **
  • Posts: 54
    • BeaumarisWX
Re: weatherextremes.php FIX
« Reply #15 on: November 17, 2023, 06:16:09 PM »
try replacing with this on php script

$siteSource = "http://51.89.234.241/cgi-bin/gsynext?lang=en&state=$country&rank=$stations&ano=$year&mes=$month&day=$day&hora=$hour&Send=send";

if not, maybe this

$siteSource = "http://www.ogimet.com/cgi-bin/gsynext?lang=en&state=$country&rank=$stations&ano=$year&mes=$month&day=$day&hora=$hour&Send=send";


because I suspect that your hosting site preventing it to parse with real website so instead, try OGIMET's IP address maybe it works

Well eons ago it never worked and now it does, thanks again.
https://beaumaris-weather.com/worldextremes.php?sce=view
https://beaumaris-weather.com/worldextremes.php
https://beaumaris-weather.com/wxworldextremes.php
https://beaumaris-weather.com/BWX/worldextremes.php

Kindest Regards,
Tony
« Last Edit: November 19, 2023, 04:55:48 AM by BeaumarisWX »
Tony Beaumaris, Tasmania (Australia)
CumulusMX GUI : https://beaumaris-weather.com/MXUI/
Saratoga Template : https://beaumaris-weather.com

Offline CrondallWeather

  • Crondall Weather
  • Member
  • *
  • Posts: 21
  • Still a classic - like so many of us....
    • Crondall Weather
Re: weatherextremes.php FIX
« Reply #16 on: November 18, 2023, 03:09:32 AM »
Switching the site source to

Code: [Select]
$siteSource = "http://51.89.234.241/cgi-bin/gsynext?lang=en&state=$country&rank=$stations&ano=$year&mes=$month&day=$day&hora=$hour&Send=send";
did the trick for me too  [tup]

Perfect, thank you.

Offline BeaumarisWX

  • Senior Member
  • **
  • Posts: 54
    • BeaumarisWX
Re: weatherextremes.php FIX
« Reply #17 on: November 18, 2023, 05:34:24 PM »
Hi cheers. Yeah I tried that when you posted same eons ago. Makes no dif.
As I mentioned I think it may be a server blocked by the other.
Cheers.

Tony,  might be worth tracing the route from your site to see what is block.  I am guessing the block is  probably a firewall rule on ogimet against your the hosting company you use.

anyone else require a worldextremes.php  they can download an updated version here:

https://www.conligwx.org/worldextremes.php?sce=view

https://www.conligwx.org/wxextremes.php  <-viewed in Saratoga Templates.

https://www.conligwx.org/worldextremes.php  - without templates.

Hi Simon,
I found on your/Mapantz version that there are some code issues.
1 :
Code: [Select]
(<h4...</h5>) <h4 style="padding-left:2px">In the last 24 hours up to <?php echo $hour ?>:00 UTC - <?php echo $day."/".$month."/".$year?></h5>2 : The KMHtoMPH switch is coded to only allow MPH (really needs another variable purely for Wind, can be easily done, though not had time, so just bodged mine for now to display KMH.
Code: [Select]
//$uomGustE   = ' km/h';     // kilometres per hour
$uomGustM   = ' mph';     // miles per hour

// Start Unit Conversion if Needed

function KMHtoMPH($fixgust) {
  global $useunits, $uomGustE, $uomGustM;
  if ($useunits == 'I') { // convert km/h to mph
    return number_format(($fixgust / 1.60934), 1, '.', '') . $uomGustE;
  } else { // leave in mph
    return number_format(($fixgust / 1.60934), 1, '.', '') . $uomGustM;
  }
}

Kindest Regards,
Tony
« Last Edit: November 19, 2023, 06:04:30 PM by BeaumarisWX »
Tony Beaumaris, Tasmania (Australia)
CumulusMX GUI : https://beaumaris-weather.com/MXUI/
Saratoga Template : https://beaumaris-weather.com

Offline ConligWX

  • Forecaster
  • *****
  • Posts: 873
  • #conligwx
    • conligwx.org
Re: weatherextremes.php FIX
« Reply #18 on: November 19, 2023, 05:47:20 AM »
Tony

I thought ogimet.com values are in km/h to begin with afaik. 

Quote
// Start Unit Conversion if Needed

Australia for instance shows km/h without me selecting any parameter

https://www.ogimet.com/cgi-bin/gsynres?lang=en&state=Austra

cant find on ogimets website what values they show but guessing they are all metric.
« Last Edit: November 19, 2023, 05:56:19 AM by ConligWX »
Regards Simon
Davis Vantage Pro2 Plus (6162UK) • Daytime FARS • WeatherLink Live • AirLink • PurpleAir PA-II-SD • CumulusMX • ADSB.im • Pi 4 • AirSpy mini • Uputronics Filtered 1090 Preamp


Offline BeaumarisWX

  • Senior Member
  • **
  • Posts: 54
    • BeaumarisWX
Re: weatherextremes.php FIX
« Reply #19 on: November 19, 2023, 11:07:42 PM »
Tony

I thought ogimet.com values are in km/h to begin with afaik. 

Quote
// Start Unit Conversion if Needed

Australia for instance shows km/h without me selecting any parameter

https://www.ogimet.com/cgi-bin/gsynres?lang=en&state=Austra

cant find on ogimets website what values they show but guessing they are all metric.

Hi Simon,
Yes that is all correct, however someone put the switch in so that UK per say can have metric units for Temp/Rain and MPH for Wind.
That switch does not work and it never would, have you tried to display wind in KMH ?
I see that PaulMy must have tried as his Wind has no KMH or MPH. http://www.komokaweather.com/komokaweather-ca/worldextremes.php
 [ You are not allowed to view attachments ]

I have re-written the file in order to allow the switch's to work correctly, Allows (Metriic and MPH Wind) or (Imperial and KMH Wind) whatever you want.
I actually wrote 2 versions : ?sce=view works on both below.
1 : The standard Single Units Column : https://beaumaris-weather.com/worldextremes_single_units.php
2 : The standard but with Both Units Column (so Imperial / Metric in same Column ) : https://beaumaris-weather.com/worldextremes_both_units.php
You can also in the Both Units version use the switches to Have say (Metric Temp/Rain First and MPH Wind First) as you see in the example image below.
 [ You are not allowed to view attachments ]

Anyway just thought I would share it.
Hopefully you understand and maybe someone finds it useful.

Oops : Nearly forgot : You will need to change the Site to Pass in lines 123/124 if you normally use one or the or the other (Mine only works with the current one set).

From :
Code: [Select]
/////////////////////////////////////////////////////////////////////////////
// Site to Parse ( NOTE : Swap below Sitesource if it does not work, default most use is the first one ogimet.com )
//$siteSource = "https://ogimet.com/cgi-bin/gsynext?lang=en&state=$country&rank=20&ano=$year&mes=$month&day=$day&hora=$hour&Send=send";
$siteSource = "http://51.89.234.241/cgi-bin/gsynext?lang=en&state=$country&rank=20&ano=$year&mes=$month&day=$day&hora=$hour&Send=send";
/////////////////////////////////////////////////////////////////////////////

To :
Code: [Select]
/////////////////////////////////////////////////////////////////////////////
// Site to Parse ( NOTE : Swap below Sitesource if it does not work, default most use is the first one ogimet.com )
$siteSource = "https://ogimet.com/cgi-bin/gsynext?lang=en&state=$country&rank=20&ano=$year&mes=$month&day=$day&hora=$hour&Send=send";
//$siteSource = "http://51.89.234.241/cgi-bin/gsynext?lang=en&state=$country&rank=20&ano=$year&mes=$month&day=$day&hora=$hour&Send=send";
/////////////////////////////////////////////////////////////////////////////

kindest Regards,
Tony
« Last Edit: November 20, 2023, 01:05:04 AM by BeaumarisWX »
Tony Beaumaris, Tasmania (Australia)
CumulusMX GUI : https://beaumaris-weather.com/MXUI/
Saratoga Template : https://beaumaris-weather.com

Offline ConligWX

  • Forecaster
  • *****
  • Posts: 873
  • #conligwx
    • conligwx.org
Re: weatherextremes.php FIX
« Reply #20 on: November 20, 2023, 06:17:26 AM »
Nice work  [tup] =D&gt;
Regards Simon
Davis Vantage Pro2 Plus (6162UK) • Daytime FARS • WeatherLink Live • AirLink • PurpleAir PA-II-SD • CumulusMX • ADSB.im • Pi 4 • AirSpy mini • Uputronics Filtered 1090 Preamp


Offline CrondallWeather

  • Crondall Weather
  • Member
  • *
  • Posts: 21
  • Still a classic - like so many of us....
    • Crondall Weather
Re: weatherextremes.php FIX
« Reply #21 on: November 20, 2023, 07:11:41 AM »
Thanks Tony,

Being able to show both Metric and Imperial is an excellent enhancement.

Changes were easy to make  :grin: [tup]

Offline BeaumarisWX

  • Senior Member
  • **
  • Posts: 54
    • BeaumarisWX
Re: weatherextremes.php FIX
« Reply #22 on: November 22, 2023, 11:12:27 PM »
Hi,
I have made some more changes to the script.
Re-Instated some old Mods (slightly updated).
A few other changes too though pending feedback, more info here : https://cumulus.hosiene.co.uk/viewtopic.php?p=175738#p175738
Kindest Regards,
Tony
Tony Beaumaris, Tasmania (Australia)
CumulusMX GUI : https://beaumaris-weather.com/MXUI/
Saratoga Template : https://beaumaris-weather.com

Offline BeaumarisWX

  • Senior Member
  • **
  • Posts: 54
    • BeaumarisWX
Re: weatherextremes.php FIX
« Reply #23 on: November 23, 2023, 04:59:38 PM »
Hi,
If anyone is interested : New weatherextremes.php files created.

All the info and links here : https://cumulus.hosiene.co.uk/viewtopic.php?p=175778#p175778

kindest Regards,
Tony
Tony Beaumaris, Tasmania (Australia)
CumulusMX GUI : https://beaumaris-weather.com/MXUI/
Saratoga Template : https://beaumaris-weather.com

Offline vinesweather

  • Forecaster
  • *****
  • Posts: 342
    • The Vines Weather
Re: weatherextremes.php FIX
« Reply #24 on: November 24, 2023, 12:00:24 AM »
Thanks Tony. I look forward to implementing this.

Chris