Author Topic: WU Underground, REALLY?  (Read 2724 times)

0 Members and 2 Guests are viewing this topic.

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8568
    • Meteotemplate
Re: WU Underground, REALLY?
« Reply #25 on: April 27, 2017, 08:11:37 AM »
Aha... now I see, thanks a lot for clarification. I thought that the 10min means max 1 request /10 min. So is there any limit as to how many different locations you are allowed to load? Assuming you use say 1h caching for each?

Offline weatherc

  • Senior Contributor
  • ****
  • Posts: 277
Re: WU Underground, REALLY?
« Reply #26 on: April 27, 2017, 08:19:43 AM »
Aha... now I see, thanks a lot for clarification. I thought that the 10min means max 1 request /10 min. So is there any limit as to how many different locations you are allowed to load? Assuming you use say 1h caching for each?

When smartphones was newer had they a problem with apps what reloaded soon as the location changed say 0.00001°. I don't know how that ended re limiting else than i think they rounds coordinates to 2 decimals. Sure they will block you if you bomb them with requests 24/7 but "fair use" should be OK. Allready my first yr-forecast script had a dropdown-thingy for getting different locations and it have worked OK.
For cacing have i usually used 2 hours for each as the forecast do not change that often anyway. Even longer caching should work just fine. One good thing with caching are also that the script itself loads faster if the used data are allready cached.

Offline pimohdaimaoh

  • Senior Contributor
  • ****
  • Posts: 174
  • "Be aware to our nature"
    • PIMOHWEATHER
Re: WU Underground, REALLY?
« Reply #27 on: April 27, 2017, 10:45:55 AM »
Aha... now I see, thanks a lot for clarification. I thought that the 10min means max 1 request /10 min. So is there any limit as to how many different locations you are allowed to load? Assuming you use say 1h caching for each?

Well I did the dynamic and test it by my self and try to caching them simultaeneously, as I check its cache loads, it only consumes 2mb total similar to my WU historical data which uses 1-2 mb of cache per hr, so I think it would be a piece of cake to yr.No if viewers caching their data at the same time together since the sample Ive shown you actually when I check its cache files its totally 2 mb per cache and steady in that sized whenever I load all of his diff locations together, it means yr.No has automatic clear cache or overwrites the cache file on the folder since it only uses note more than 2mb. Now im uploading the files ived made now and made it a total of 16MB after my setup with this
« Last Edit: April 27, 2017, 10:53:09 AM by pimohdaimaoh »

My test Site:
http://pimohweather.webutu.com
My CWOP ID: EW0758

Offline pimohdaimaoh

  • Senior Contributor
  • ****
  • Posts: 174
  • "Be aware to our nature"
    • PIMOHWEATHER
Re: WU Underground, REALLY?
« Reply #28 on: April 27, 2017, 10:53:41 AM »
Aha... now I see, thanks a lot for clarification. I thought that the 10min means max 1 request /10 min. So is there any limit as to how many different locations you are allowed to load? Assuming you use say 1h caching for each?

Well I did the dynamic and test it by my self and try to caching them simultaeneously, as I check its cache loads, it only consumes 2mb total similar to my WU historical data which uses 1-2 mb of cache per hr, so I think it would be a piece of cake to yr.No if viewers caching their data at the same time together since the sample Ive shown you actually when I check its cache files its totally 2 mb per cache and steady in that sized whenever I load all of his diff locations together, it means yr.No has automatic clear cache or overwrites the cache file on the folder since it only uses note more than 2mb. Now im uploading the files ived made now and made it a total of 16MB after my setup with this

My test Site:
http://pimohweather.webutu.com
My CWOP ID: EW0758

Offline pimohdaimaoh

  • Senior Contributor
  • ****
  • Posts: 174
  • "Be aware to our nature"
    • PIMOHWEATHER
Re: WU Underground, REALLY?
« Reply #29 on: April 27, 2017, 10:59:57 AM »
Its almost done, the problem I have to solve now is to add select option for different town on my country, not just only my place example selecting Quezon city or Makati, baguio etc.
Maybe this will help?

Attached 3 adapted scripts from your previous download.

1. ALWAYS make a backup of the current folder first!
2. Unzip attachement
3. Replace the three scripts.

This will add multi selection to the stand-alone yr.no forecast script.

In an upcoming release these changes will be included a little more professional than this QAD version, but I think this is what you were looking for. Check the settings and add a reasonable amount of cities. Try not to compete with the yr.no site as they are so friendly to supply you free-of-charge with the forecasts.

The discussion about the use of the API is besides this topic, but as far as my Norwegian goes:
You are not allowed to re-load the same forecast to quickly => you have to cache.
And besides that, the forecast has  "valid until" and "new update available at" stamps, so loading to frequently is out of the question if you use those times.

Far more important as this reallyp*ss*s me off: When using someones script and asking for help, it is common decency to give the URL to the page. Not a  screenshot as that does not help to check the scripts and the settings.

Wim

yay I didnd read this, anyways thank you for the share, I wil use this after some observation since I already uploading using my own searched selector, just to make sure first that our theories are correct  =D>

My test Site:
http://pimohweather.webutu.com
My CWOP ID: EW0758

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8568
    • Meteotemplate
Re: WU Underground, REALLY?
« Reply #30 on: April 27, 2017, 11:18:10 AM »
So, you just thanked Wim for letting you know you should ALWAYS provide a URL and instead you post a screenshot again and there is no link on your website to that script.  ](*,) ](*,) ](*,)

So either you want to get help and co-operate or if you want to do things your way, thats fine, but then write your own scripts as well. You are just wasting Wim´s time.

Offline pimohdaimaoh

  • Senior Contributor
  • ****
  • Posts: 174
  • "Be aware to our nature"
    • PIMOHWEATHER
Re: WU Underground, REALLY?
« Reply #31 on: April 27, 2017, 08:56:19 PM »
So, you just thanked Wim for letting you know you should ALWAYS provide a URL and instead you post a screenshot again and there is no link on your website to that script.  ](*,) ](*,) ](*,)

So either you want to get help and co-operate or if you want to do things your way, thats fine, but then write your own scripts as well. You are just wasting Wim´s time.

My url is within my website below, thats why I dont link it because its always in my sig?  he can check it there, anything scripth are all on my web site below.  http://pimohweather.webutu.com/YRNO.php

My test Site:
http://pimohweather.webutu.com
My CWOP ID: EW0758

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8568
    • Meteotemplate
Re: WU Underground, REALLY?
« Reply #32 on: April 27, 2017, 09:08:53 PM »
Yes, because you have just added the link to your yrno page to the menu

It was not there before, I checked it so don't try to make me look like an idiot

Offline pimohdaimaoh

  • Senior Contributor
  • ****
  • Posts: 174
  • "Be aware to our nature"
    • PIMOHWEATHER
Re: WU Underground, REALLY?
« Reply #33 on: April 27, 2017, 10:02:45 PM »
Yes, because you have just added the link to your yrno page to the menu

It was not there before, I checked it so don't try to make me look like an idiot

I dont get it, you want me to link my page then you will tell me now that "it wasnt there before" I uploaded my Yr.No page last night at 12: 17 am, so I expect you saw on that time, if you check it before that time I mentioned, you will really never see there thats why I post a screen shot because that screenshot was only test on my local host using XAMPP ok?,  not on the web site.

My test Site:
http://pimohweather.webutu.com
My CWOP ID: EW0758

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8568
    • Meteotemplate
Re: WU Underground, REALLY?
« Reply #34 on: April 27, 2017, 10:16:00 PM »
But you didn't have a link in the menu so how were we supposed to know where you uploaded it

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1260
    • My PWS at Leuven Belgium Europe
Re: WU Underground, REALLY?
« Reply #35 on: April 28, 2017, 02:31:15 AM »
Aha... now I see, thanks a lot for clarification. I thought that the 10min means max 1 request /10 min. So is there any limit as to how many different locations you are allowed to load? Assuming you use say 1h caching for each?

Well I did the dynamic and test it by my self and try to caching them simultaeneously, as I check its cache loads, it only consumes 2mb total similar to my WU historical data which uses 1-2 mb of cache per hr, so I think it would be a piece of cake to yr.No if viewers caching their data at the same time together since the sample Ive shown you actually when I check its cache files its totally 2 mb per cache and steady in that sized whenever I load all of his diff locations together, it means yr.No has automatic clear cache or overwrites the cache file on the folder since it only uses note more than 2mb. Now im uploading the files ived made now and made it a total of 16MB after my setup with this
I am not sure I understand your point, let me explain:
The Leuven scripts (1) read the xml forecast data (2) convert them to the units used on the website (3) convert icons (4-8) a.s.o. and (9)  save the resulting php array into the ./cache/ folder. Subsequent requests for the same data start with reading the arrays, on slower webservers this will easily remove 0.5 - 1  second from the response times especially on busier hours.

The  script using the yrno forecast needs two different xml files which result in two small cache files of 22 and 26 KB.

Most Leuven-forecast scripts replace the cache every two hours and / or check if a new forecast is available:
This can be checked in the generated html
Code: [Select]
<!-- module yrnoGenerateHtml.php (32): loading ./wsyrnofct/yrnoCreateArr.php -->
<!-- module yrnoCreateArr.php ==== version: 3.20 2015-08-25 -->
<!-- module yrnoCreateArr.php (194):./cache/yrnoCreateArr.php-en-United_Statesxxxxx-fmhininhg loaded from cache
next-update at 2017-04-28T03:00:00-05:00 (1493366400)
it is now      2017-04-28T01:40:54-05:00 (1493361654)  -->
<!-- module yrnoGenerateHtml.php (370):
temp max: 63 temp min: 37 temp step: 10  temp max: 80 temp min: 10 icon: 75
rain max: 3.6   rain step: 0.6
baro max: 32 baro min: 28.5
wind max: 48 wind step: 8
 -->
<!-- module yrnoGenerateHtml.php (592): loading ./wsyrnofct/yrnoCreateDetailArr.php -->
<!-- module yrnoCreateDetailArr.php ==== version: 3.20 2015-08-02 -->
<!-- module yrnoCreateDetailArr.php (174): ./cache/yrnoCreateDetailArr.php-en-United_Statesxxxxxx-fmhininhg loaded from cache
next-update at 2017-04-28T03:00:00-05:00 (1493366400)
it is now      2017-04-28T01:40:54-05:00 (1493361654)  -->
<!-- start output ws_yrno_page -->

===

I think that there is no use to adapt the scripts for caching the way they are built now.

I am writing a new version of all forecast scripts this summer (after NWS cut-over) so if you have ideas for improvement, please let me know.

Wim
« Last Edit: April 28, 2017, 02:52:28 AM by wvdkuil »
Leuven-Template&Scripts: https://support.leuven-template.eu/
My PWS at home https://weer.sluispark.be/
And at my daughters house https://www.weerstation-herent.be/

Offline pimohdaimaoh

  • Senior Contributor
  • ****
  • Posts: 174
  • "Be aware to our nature"
    • PIMOHWEATHER
Re: WU Underground, REALLY?
« Reply #36 on: April 28, 2017, 11:00:01 AM »
Aha... now I see, thanks a lot for clarification. I thought that the 10min means max 1 request /10 min. So is there any limit as to how many different locations you are allowed to load? Assuming you use say 1h caching for each?

Well I did the dynamic and test it by my self and try to caching them simultaeneously, as I check its cache loads, it only consumes 2mb total similar to my WU historical data which uses 1-2 mb of cache per hr, so I think it would be a piece of cake to yr.No if viewers caching their data at the same time together since the sample Ive shown you actually when I check its cache files its totally 2 mb per cache and steady in that sized whenever I load all of his diff locations together, it means yr.No has automatic clear cache or overwrites the cache file on the folder since it only uses note more than 2mb. Now im uploading the files ived made now and made it a total of 16MB after my setup with this
I am not sure I understand your point, let me explain:
The Leuven scripts (1) read the xml forecast data (2) convert them to the units used on the website (3) convert icons (4-8) a.s.o. and (9)  save the resulting php array into the ./cache/ folder. Subsequent requests for the same data start with reading the arrays, on slower webservers this will easily remove 0.5 - 1  second from the response times especially on busier hours.

The  script using the yrno forecast needs two different xml files which result in two small cache files of 22 and 26 KB.

Most Leuven-forecast scripts replace the cache every two hours and / or check if a new forecast is available:
This can be checked in the generated html
Code: [Select]
<!-- module yrnoGenerateHtml.php (32): loading ./wsyrnofct/yrnoCreateArr.php -->
<!-- module yrnoCreateArr.php ==== version: 3.20 2015-08-25 -->
<!-- module yrnoCreateArr.php (194):./cache/yrnoCreateArr.php-en-United_Statesxxxxx-fmhininhg loaded from cache
next-update at 2017-04-28T03:00:00-05:00 (1493366400)
it is now      2017-04-28T01:40:54-05:00 (1493361654)  -->
<!-- module yrnoGenerateHtml.php (370):
temp max: 63 temp min: 37 temp step: 10  temp max: 80 temp min: 10 icon: 75
rain max: 3.6   rain step: 0.6
baro max: 32 baro min: 28.5
wind max: 48 wind step: 8
 -->
<!-- module yrnoGenerateHtml.php (592): loading ./wsyrnofct/yrnoCreateDetailArr.php -->
<!-- module yrnoCreateDetailArr.php ==== version: 3.20 2015-08-02 -->
<!-- module yrnoCreateDetailArr.php (174): ./cache/yrnoCreateDetailArr.php-en-United_Statesxxxxxx-fmhininhg loaded from cache
next-update at 2017-04-28T03:00:00-05:00 (1493366400)
it is now      2017-04-28T01:40:54-05:00 (1493361654)  -->
<!-- start output ws_yrno_page -->

===

I think that there is no use to adapt the scripts for caching the way they are built now.

I am writing a new version of all forecast scripts this summer (after NWS cut-over) so if you have ideas for improvement, please let me know.

Wim

Yeah I understand now and I thank you for sharing that scripts and to understand more its diff. behaviour, well im not more advance knowledge of .php scripts that far only minimal. Well since you ask me for any improvements, if you can add its forecast declarations like WXSIM forecast. example instead of saying in forecast that : " period = 12-1:00 pm forecast= partly cloudy" turned into this in a little more detail the better. into this: " period = 12-1:00 pm forecast= "partly cloudy, w/ some thunderstorms, then mostly cloudy in the afternoon with some rain showers and thunderstorms specially in the evening" <--- something like that to give a little detail in forecast. Well its just only my Idea its up to you if you could do, but looking your current script is cool and awesome already and presentable to me with graphs you made, I can see clearly the changes of weather time to time further that our local weather agency doesnt have. http://pimohweather.webutu.com/YRNO.php if you check the PAGASA website right now, you will dissapoint that their web site is down because it declared as holiday due to the summit helt today which is embarrassing http://www.pagasa.dost.gov.ph/
« Last Edit: April 28, 2017, 11:06:31 AM by pimohdaimaoh »

My test Site:
http://pimohweather.webutu.com
My CWOP ID: EW0758

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8568
    • Meteotemplate
Re: WU Underground, REALLY?
« Reply #37 on: April 28, 2017, 06:01:52 PM »
Its not just about what "Wim wants to include" - it is about what the API/page provides and I am 99.9% sure WU does not have anything like that, the textual forecast consists of these very short strings like "partly cloudy", "sunny" etc. Also remember that these are also translated so if a human was writing these long, always unique strings everything would only be in English and it would also be basically impossible to choose an icon.

These things are automated so can only provide as much detail.