Author Topic: Support of "Leuven" WeatherUnderground scripts  (Read 3976 times)

0 Members and 1 Guest are viewing this topic.

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1699
    • My PWS at Leuven Belgium Europe
Support of "Leuven" WeatherUnderground scripts
« on: March 28, 2019, 02:43:07 PM »
Coloured tables
Demo: https://www.weerstation-herent.be/wsreports/_test1.php
Download: https://leuven-template.eu/leuven_download2019.php?id=reports
Readme: N/A There are only a few settings to adjust, they are at the first lines of the start-script
Known issues:  2019-11-22: The solution for missing data in WU .CSV  is now also included in the download, readme here

History tables
This is an alternative script for the widely used Jim McMurry script. My version does not contain any http-links, so that those "d*mn*d" bots can not follow the links.
Demo: https://leuven-template.eu/wuhistory/_test1.php
Download: https://leuven-template.eu/leuven_download2019.php?id=history
Readme: N/A There are only a few settings to adjust, they are at the first lines of the start-script
Known issues: 2019-11-22: The solution for missing data in WU .CSV  is now also included in the download, readme here

Both scripts are relative easy to install and can be used stand-alone, in an iframe and in the Leuven- or Saratoga-Template.

Support:
When you post questions about the scripts, please always include the URL (=correct link)  to the script on your website. That reduces the time for answering your questions.

Wim
Updates: 2019-11-24 Added readme for WU .CSV "problems" + updated download with the extra script
« Last Edit: November 24, 2019, 09:21:21 AM by wvdkuil »
Support for Leuven-Template & Scripts  at this forum via https://support.leuven-template.eu/
Script sponsors support.leuven-template.eu/userlistScripts.php
Template sponsors support.leuven-template.eu/userlist.php

Support for the PWS_Dashboard  pwsdashboard.com

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 8009
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Support of "Leuven" WeatherUnderground scripts
« Reply #1 on: March 28, 2019, 02:49:42 PM »
Thanks again, Wim!
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline txweather.org

  • Forecaster
  • *****
  • Posts: 1534
    • Texas Weather
Re: Support of "Leuven" WeatherUnderground scripts
« Reply #2 on: March 28, 2019, 03:16:13 PM »
Thank you wim!

----
Davis Vantage Pro2 Plus +FARS|Meteobridge Nano SD|Meteohub|Meteobridge MR-3020|WU KTXSPRIN75/PWS JRARGWX75/CWOP EW2972/WBB TXWDVUE75/Blitzortung ID: 1142|AWEKAS: 12095
Donations are welcome: https://paypal.me/ffuentesb

Offline MarkDM

  • Member
  • *
  • Posts: 3
    • Weerstation Berlare
Re: Support of "Leuven" WeatherUnderground scripts
« Reply #3 on: May 23, 2019, 03:42:12 PM »
Since a few days I get no new graphs from WU : http://weerstation.uitbergen.net/index.php?p=62-2&lang=nl#data-area
I notice I am not alonce suffering this problem:
http://meteoroosendaal.nl/index.php?p=62-2&lang=nl#data-area
Meteobridge is still uploading. What can be wrong ?

Offline waiukuweather

  • Forecaster
  • *****
  • Posts: 912
Re: Support of "Leuven" WeatherUnderground scripts
« Reply #4 on: May 23, 2019, 04:32:44 PM »
WU has problems with the history download
(there are other threads about that)

Offline MarkDM

  • Member
  • *
  • Posts: 3
    • Weerstation Berlare
Re: Support of "Leuven" WeatherUnderground scripts
« Reply #5 on: July 28, 2019, 06:43:13 AM »
Thank you.
Yesterday I noticed that the problem is solved in Wim's website:
https://weer.sluispark.be/index.php?p=mnu_wu_graph&lang=nl#data-area
Can we find somewhere what we have to do ? At my station WU graphs are still missing...
http://weerstationberlare.be/index.php?p=62-2&lang=nl#data-area
I am not alone:
http://meteoroosendaal.nl/index.php?p=62-2&lang=nl#data-area
« Last Edit: July 28, 2019, 06:47:32 AM by MarkDM »

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1699
    • My PWS at Leuven Belgium Europe
Re: Support of "Leuven" WeatherUnderground scripts
« Reply #6 on: July 28, 2019, 03:02:27 PM »
Thank you.
Yesterday I noticed that the problem is solved in Wim's website:
https://weer.sluispark.be/index.php?p=mnu_wu_graph&lang=nl#data-area
Can we find somewhere what we have to do ? At my station WU graphs are still missing...
http://weerstationberlare.be/index.php?p=62-2&lang=nl#data-area
I am not alone:
http://meteoroosendaal.nl/index.php?p=62-2&lang=nl#data-area
As you are a native Dutch speaker,  check the Dutch forum here with an active topic about this for 7 weeks already.  You will find some solutions and the do's and dont's

Or check the numerous topics on this forum about the WU .csv problems.
Wim
Support for Leuven-Template & Scripts  at this forum via https://support.leuven-template.eu/
Script sponsors support.leuven-template.eu/userlistScripts.php
Template sponsors support.leuven-template.eu/userlist.php

Support for the PWS_Dashboard  pwsdashboard.com

Offline MarkDM

  • Member
  • *
  • Posts: 3
    • Weerstation Berlare
Re: Support of "Leuven" WeatherUnderground scripts
« Reply #7 on: July 29, 2019, 02:01:36 PM »
Hello Wim,
Thank you for your reply. I did not know about that forum. It is not mentioned in the Leuven-Template support pages.
But it will help me out.
Thanks again.
Mark

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1699
    • My PWS at Leuven Belgium Europe
Re: Support of "Leuven" WeatherUnderground scripts
« Reply #8 on: November 16, 2019, 03:09:14 AM »
I got this request as a private message, but it seems better to answer it here:
Quote
Hi wim I downloaded on your site leuven the script colored table For some time I noticed that the data of the year are gone for 2019 that of the years precedent are not erased. A few days ago I had the data only from the end of October and November and nothing since the beginning of the year and since yesterday I have all the data until August 20, 2019 and since then nothing? would you have an idea of what's going on? I thank you in advance good evening

Cause:
WU is now owned by the WeatherChannel which is an IBM company.

The last months there  are severe problems with the WU database.  We use  a WU-.asp script to download data from the database in .CSV files

"Management at IBM" tell us that the .CSV will cease to exist and is not supported anymore.

But the programmers  are still working on it, hence the fluctuating periods for new requests.
But it seems they lost the whole "old" database before October 20


Backup: @ALL Important
The old years data is cached in the  wudata/ (or in the .cache/ ) folder on your server. 
Make a backup of those files, there is 1 file for each year. 
www . your website. xxx /wsreports/wuData/__WUID__-year-2018.txt
and all earlier years.

If you happen to have data until august 2019, copy that file also.

Save those files for future use on your PC at home.

Solution:
Script authors as Ken True and myself are working on solutions to access 
And yes the adapted scripts seem to work if you check my station-sites, but it need fine-tuning, documentation and more testing.

It will be  a few weeks before general availabilty.

And I still sincerely hope that WU would get their act together and make the .CSV files available, maybe using our WU_API-keys

Wim

Support for Leuven-Template & Scripts  at this forum via https://support.leuven-template.eu/
Script sponsors support.leuven-template.eu/userlistScripts.php
Template sponsors support.leuven-template.eu/userlist.php

Support for the PWS_Dashboard  pwsdashboard.com

Offline Stromseth

  • Member
  • *
  • Posts: 6
    • BJFF Weather stations
Re: Support of "Leuven" WeatherUnderground scripts
« Reply #9 on: November 17, 2019, 06:32:41 AM »
As you are a native Dutch speaker,  check the Dutch forum here with an active topic about this for 7 weeks already.  You will find some solutions and the do's and dont's

Seems like that topic does not exist anymore on hetweeractueel.nl

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1699
    • My PWS at Leuven Belgium Europe
Re: Support of "Leuven" WeatherUnderground scripts
« Reply #10 on: November 17, 2019, 06:38:46 AM »
As you are a native Dutch speaker,  check the Dutch forum here with an active topic about this for 7 weeks already.  You will find some solutions and the do's and dont's

Seems like that topic does not exist anymore on hetweeractueel.nl
No they had a server-crash a few weeks ago, losing all data after 2018.
They are working to rebuild the complete site in the coming months.

If you understand  dutch  this one https://leuven-template.eu/smf/index.php?board=34.0 also list the status for different "WU-dependant" scripts.

Wim
Support for Leuven-Template & Scripts  at this forum via https://support.leuven-template.eu/
Script sponsors support.leuven-template.eu/userlistScripts.php
Template sponsors support.leuven-template.eu/userlist.php

Support for the PWS_Dashboard  pwsdashboard.com

Offline Stromseth

  • Member
  • *
  • Posts: 6
    • BJFF Weather stations
Re: Support of "Leuven" WeatherUnderground scripts
« Reply #11 on: November 17, 2019, 06:39:24 AM »
But it seems they lost the whole "old" database before October 20

My problem seems to be the exact opposite  :?
wxStartReports.php daily report shows data until mid October but nothing after. The data exists as far as I can understand; downloaded / cached with WXDailyHistory.php.

wxStartReports.php version 4.00

Stian

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1699
    • My PWS at Leuven Belgium Europe
Re: Support of "Leuven" WeatherUnderground scripts
« Reply #12 on: November 17, 2019, 06:54:24 AM »
But it seems they lost the whole "old" database before October 20
My problem seems to be the exact opposite  :?
wxStartReports.php daily report shows data until mid October but nothing after. The data exists as far as I can understand; downloaded / cached with WXDailyHistory.php
wxStartReports.php version 4.00
Stian
The scripts of your version do not contain a link to WXDailyHistory.php
You should also adapt line 173 in wsreports/wsReports1part.php from
Code: [Select]
$wuURLs[] = 'https://www.wunderground.com/weatherstation/WXDailyHistory.asp?ID='.$SITE['wuID'].'&month=01&day=01&year='.$i.'&format=1&graphspan=year'; to
Code: [Select]
$wuURLs[] = 'http://www.altevatnet.no/WXDailyHistory.php?ID='.$SITE['wuID'].'&month=01&day=01&year='.$i.'&format=1&graphspan=year'; or equivilent, depending on where you installed Ken True's version of the "Man-In-The-Middle" script.
If you did not install that WXDailyHistory.php script, you also need to set your WU-Api key and do the other things as advised in this document:
Saratoga solution: https://github.com/ktrue/WU-History/blob/master/README.md

Wim
Support for Leuven-Template & Scripts  at this forum via https://support.leuven-template.eu/
Script sponsors support.leuven-template.eu/userlistScripts.php
Template sponsors support.leuven-template.eu/userlist.php

Support for the PWS_Dashboard  pwsdashboard.com

Offline Stromseth

  • Member
  • *
  • Posts: 6
    • BJFF Weather stations
Re: Support of "Leuven" WeatherUnderground scripts
« Reply #13 on: November 17, 2019, 07:32:47 AM »
The scripts of your version do not contain a link to WXDailyHistory.php

Aaaahh! Thank you so much!
Changed the $wuURLs, deleted the already downloaded data and reloaded. Now my WU-data is complete.

Really appreciate your quick and accurate response!  =D>

Stian

Offline Stromseth

  • Member
  • *
  • Posts: 6
    • BJFF Weather stations
wxStartReports.php language bug?
« Reply #14 on: November 17, 2019, 07:43:36 AM »
One more thing, sorry for spamming this topic now ...

I'm not sure if it's just me, but I had to change a few lines in wxStartReports.php to make my localization work.

Lines 81 and 82 states:
Code: [Select]
$saved_lang = $lang;
$SITE['lang'] = $lang;

I'm not sure if these two lines make sense? Both $saved_lang and $lang seems empty when wxStartReports.php is loaded.

I changed the lines to
Code: [Select]
$lang = $SITE['lang'];
$saved_lang = $lang;
and now the localization / language selection works as it should. The $lang parameter is loaded with the sitewide language code and the correct wulanguage-??.txt is loaded.

Stian

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1699
    • My PWS at Leuven Belgium Europe
Re: wxStartReports.php language bug?
« Reply #15 on: November 17, 2019, 08:19:22 AM »
One more thing, sorry for spamming this topic now ...

I'm not sure if it's just me, but I had to change a few lines in wxStartReports.php to make my localization work.

Lines 81 and 82 states:
Code: [Select]
$saved_lang = $lang;
$SITE['lang'] = $lang;

I'm not sure if these two lines make sense? Both $saved_lang and $lang seems empty when wxStartReports.php is loaded.

I changed the lines to
Code: [Select]
$lang = $SITE['lang'];
$saved_lang = $lang;
and now the localization / language selection works as it should. The $lang parameter is loaded with the sitewide language code and the correct wulanguage-??.txt is loaded.

Stian
I am not able to quickly test with a working Saratoga website. If it works for you, it is OK.
The version I tested with, years ago, always had $lang set to the selected or default language. But it could be  a misinterpretation on my side also. 

Wim
Support for Leuven-Template & Scripts  at this forum via https://support.leuven-template.eu/
Script sponsors support.leuven-template.eu/userlistScripts.php
Template sponsors support.leuven-template.eu/userlist.php

Support for the PWS_Dashboard  pwsdashboard.com

Offline lacouste

  • Member
  • *
  • Posts: 5
Re: Support of "Leuven" WeatherUnderground scripts
« Reply #16 on: February 03, 2020, 05:33:30 PM »
hello here I am contacting you for help
2 things
I have the scrpit https://meteolimoux.fr/wugraphs.php
it worked well but since I solved the problem of wunderground with the colored table this one has more and more trouble to function and sometimes does not display the graphs of the day so how to make this super script work again?
the second thing is that my host went from http to https so I can no longer manage in all the files in the folder to correct the correct path in https so that the script can work again
thank you in advance good end of the evening

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1699
    • My PWS at Leuven Belgium Europe
Re: Support of "Leuven" WeatherUnderground scripts
« Reply #17 on: February 04, 2020, 02:50:51 AM »
. . .  shortened . . .
I have the scrpit https://meteolimoux.fr/wugraphs.php
it worked well but since I solved the problem of wunderground with the colored table this one has more and more trouble to function and sometimes does not display the graphs of the day so how to make this super script work again?
This topic you are posting in is for Leuven-scripts.
The scripts at https://meteolimoux.fr/wugraphs.php  are not written by me, they are from another author. And your version does not show anything at all.
The html is incomplete and essential scripts, such as jquery are not loaded as you forgot to change the http link to https
Quote
Mixed Content: The page at 'https://meteolimoux.fr/wugraphs.php' was loaded over HTTPS, but requested an insecure script 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'.
This request has been blocked; the content must be served over HTTPS.

At the bottom of that page it reads "WU-Graphs  v 1.8.0 © 2010 " by "Radomir Luza"

Probably there are dozens of discussions about these scripts and as far as you can check at multiple user-sites  they normally run in https and can be easily adapted to use the .CSV replacement scripts from Ken True or myself.

And you can always check the thank-you mail you got when you donated for these scripts at the authors download site?

Wim
Support for Leuven-Template & Scripts  at this forum via https://support.leuven-template.eu/
Script sponsors support.leuven-template.eu/userlistScripts.php
Template sponsors support.leuven-template.eu/userlist.php

Support for the PWS_Dashboard  pwsdashboard.com

Offline MétéoOrsay

  • Member
  • *
  • Posts: 2
    • Météo Orsay
Re: Support of "Leuven" WeatherUnderground scripts
« Reply #18 on: March 08, 2020, 02:44:09 PM »
Hello,
I successfully installed the WU-History-master module and recovered all the data from WU. It has been running very well for over a month.
Looking at the data https://www.meteo-orsay.fr/custom/WU-History-master/WXDailyHistory.php?&year=2020&graphspan=year&debug=y, they are correct but not displayed for rain data .
Indeed, it is displayed in tenths of mm instead of mm!
Have you ever noticed this problem?
https://www.meteo-orsay.fr/custom/wsreports_new.php
Thank you in advance.


Offline MétéoOrsay

  • Member
  • *
  • Posts: 2
    • Météo Orsay
Re: Support of "Leuven" WeatherUnderground scripts
« Reply #19 on: March 11, 2020, 10:52:19 AM »
Hello,
I successfully installed the WU-History-master module and recovered all the data from WU. It has been running very well for over a month.
Looking at the data https://www.meteo-orsay.fr/custom/WU-History-master/WXDailyHistory.php?&year=2020&graphspan=year&debug=y, they are correct but not displayed for rain data .
Indeed, it is displayed in tenths of mm instead of mm!
Have you ever noticed this problem?
https://www.meteo-orsay.fr/custom/wsreports_new.php
Thank you in advance.

Hello,
After searching in the code, the WU-History-master script considers the rain data as being in cm instead of mm.
Having failed to modify this error, I changed the WU-reports script to take rain data in cm into account.

The changes are made in the files
- startReports.php - Line 29 change mm by cm for display in the table

- WSReport1.php - Line 318 change mm by cm for displaying the scale


Offline martin150

  • Member
  • *
  • Posts: 3
Re: Support of "Leuven" WeatherUnderground scripts
« Reply #20 on: May 13, 2020, 03:36:52 AM »
Hi,
Could you please help me.
I got an script/html error loading /wuhistory/WU-History4.php

I did make all modifications but it doesnt work.
Also reports is only working 2020. When i change to an other year also error

Links
https://www.hildner.at/weather28/index.php?p=wuhistory&lang=en#data-area&debug

https://www.hildner.at/weather28/index.php?p=wsReports&lang=en#data-area

Tnx in advance!

LG
Martin

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1699
    • My PWS at Leuven Belgium Europe
Re: Support of "Leuven" WeatherUnderground scripts
« Reply #21 on: May 13, 2020, 04:13:11 AM »
. . .
I got an script/html error loading /wuhistory/WU-History4.php
https://www.hildner.at/weather28/index.php?p=wuhistory&lang=en#data-area&debug

Script wu/WU-History4.php line 377 - 380
Code: [Select]
#--------- load the required csv from WU
$rawData        = ws_makeRequest($wu_url,$wu_test_file);
$raw            = explode ('<br>', $rawData);   ##### ! if they omit the <br> we have to change it here
#$raw            = explode ("\n", $rawData);
There were different end-of-line solutions, we are now using the \n
Change the last two lines bycommenting the line with br and uins the line with \n
Code: [Select]
#$raw            = explode ('<br>', $rawData);   ##### ! if they omit the <br> we have to change it here
$raw            = explode ("\n", $rawData);

Quote
Also reports is only working 2020. When i change to an other year also error
https://www.hildner.at/weather28/index.php?p=wsReports&lang=en#data-area
Probably  your site to went https and the links ran a short time with http.
Your webserver has sent a 301 message in plain html which the script has stored as the answer containing WU data.
Check the file:
https://www.hildner.at/weather28/wsreports/wuData/IOBERSTE7-year-2011.txt
All yearly files except this year are always used from the cache. So we have to clean the cache to get rid of the 301 erros.
Remove all yearly files (except 2020) in weather28/wsreports/wuData/ and the scripts should load the data correctly.

Thanks for using the Leuven-Template,
Best regards,
Wim
Support for Leuven-Template & Scripts  at this forum via https://support.leuven-template.eu/
Script sponsors support.leuven-template.eu/userlistScripts.php
Template sponsors support.leuven-template.eu/userlist.php

Support for the PWS_Dashboard  pwsdashboard.com

Offline martin150

  • Member
  • *
  • Posts: 3
Re: Support of "Leuven" WeatherUnderground scripts
« Reply #22 on: May 13, 2020, 04:43:40 AM »
Wow great support !!
Many tnx, i did change this /n but in another script. Now works fine!

For the reports i´ve two questions:
First i´ve already an error in the top line like:
Code: [Select]
Notice: Undefined variable: uomWrun in /home/.sites/50/site8222718/web/weather28/wsreports/wsReports1part.php on line 95
Second: When i change the year i got a standalone template and my menü is gone.
 [ You are not allowed to view attachments ]

LG Martin
PS: is there any solution for "Neighboring Stations" also from WU ??
« Last Edit: May 13, 2020, 04:48:13 AM by martin150 »

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1699
    • My PWS at Leuven Belgium Europe
Re: Support of "Leuven" WeatherUnderground scripts
« Reply #23 on: May 13, 2020, 06:22:07 AM »
. . .
For the reports i´ve two questions:
First i´ve already an error in the top line like:
Code: [Select]
Notice: Undefined variable: uomWrun in /home/.sites/50/site8222718/web/weather28/wsreports/wsReports1part.php on line 95
It seems you mixed the stand-alone version 4.0 into the template version 3.x which was designed to run into the template. Still nice that it runs at all.
This one error can be solved , replace the empty line 51 in your version of wsReports1part.php
Code: [Select]
$uomwrun = 'km';
Quote
Second: When i change the year i got a standalone template and my menü is gone.
Same problem of a mixed up version
Change line 245 in wsreports/wsReports1part.php from
Code: [Select]
if (isset ($SITE['ipad']))  {$extralang .= PHP_EOL.'<input type="hidden" style="padding: 0px; border: 0px; margin: 0px" name="ipad" value =" "/>'.PHP_EOL;}
to
Code: [Select]
if (isset ($SITE['ipad']) && $SITE['ipad'] == true)
 {$extralang .= PHP_EOL.'<input type="hidden" style="padding: 0px; border: 0px; margin: 0px" name="ipad" value =" "/>'.PHP_EOL;}
Quote
LG Martin
PS: is there any solution for "Neighboring Stations" also from WU ??

Originally those were simple html pages with a little js-code. WU allowed us to run those pages in an iFrame on our own sites.
They paid heavy money to develop and maintain the new improved pages and they understandably do not want those pages to be used in other sites.

Succes, Wim

« Last Edit: May 13, 2020, 06:27:12 AM by wvdkuil »
Support for Leuven-Template & Scripts  at this forum via https://support.leuven-template.eu/
Script sponsors support.leuven-template.eu/userlistScripts.php
Template sponsors support.leuven-template.eu/userlist.php

Support for the PWS_Dashboard  pwsdashboard.com

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1699
    • My PWS at Leuven Belgium Europe
Re: Support of "Leuven" WeatherUnderground scripts
« Reply #24 on: May 13, 2020, 10:56:05 AM »
. . .
For the reports i´ve two questions:
First i´ve already an error in the top line like:
Code: [Select]
Notice: Undefined variable: uomWrun in /home/.sites/50/site8222718/web/weather28/wsreports/wsReports1part.php on line 95
Typing error, sorry for that  :oops:
This solution
Quote
replace the empty line 51 in your version of wsReports1part.php
Code: [Select]
$uomwrun = 'km';
Should have read:
replace the empty line 51 in your version of wsReports1part.php
Code: [Select]
$uomWrun = 'km'; with a capital W

Wim
Support for Leuven-Template & Scripts  at this forum via https://support.leuven-template.eu/
Script sponsors support.leuven-template.eu/userlistScripts.php
Template sponsors support.leuven-template.eu/userlist.php

Support for the PWS_Dashboard  pwsdashboard.com

 

anything