Page 31 of 54

Re: Now available: AJAX/PHP multilingual website templates

Posted: Tue 13 Sep 2011 8:05 pm
by saratogaWX
Ok, this is very strange.

Your forecast URL from WU (the one used by the script) is http://espanol.wunderground.com/global/ ... 08391.html and right now, that page is showing the same as that displayed by the script.

What URL are you using to view the Seville forecast on WU if it is not the same one as above?

Best regards,
Ken

Re: Now available: AJAX/PHP multilingual website templates

Posted: Tue 13 Sep 2011 8:32 pm
by josebp
Edit.-
I've seen what happens ... instead of taking my station forecasting:
Sevilla-San Bernardo
As he had done since June, taking the provision of:
LEZL Sevilla, and although we are separated by 12 km .. which lay at the airport is totally wrong as the correct prediction is coming out in Sevilla-San Bernardo.
I do not know is whether you can arrange to use the back of my station.
Sorry about the problem outside the template.
Thank you.
Best regards,
José
-----------------------------------------------------------------------------------
Ya he visto lo que pasa... en vez de coger la previsión de mi estación:
Sevilla-San Bernardo
Como llevaba haciendo desde Junio, está tomando la previsión de:
Sevilla LEZL, y aunque estamos separados por 12 Km... la que ponen en el aeropuerto es totalmente errónea ya que la previsión correcta es la que sale en Sevilla-San Bernardo.
Lo que no sé es si se puede arreglar para que utilice la de mi estación de nuevo.
Perdón por el problema ajeno a la plantilla.
Gracias.
Saludos,
José

Re: Now available: AJAX/PHP multilingual website templates

Posted: Wed 14 Sep 2011 12:12 pm
by JennyLeez
Hi Ken,
re WU-forecast.php
Brilliant Brilliant Brilliant :clap:
Your ML fix for short labels is great, better than it was before. All lays out tidy once again.
The ML version is fine as the stand alone as well :)
Many many thanks for the time you have put into this.
Much appreciated by me.
Cheers
Jenny

Re: Now available: AJAX/PHP multilingual website templates

Posted: Wed 14 Sep 2011 6:49 pm
by saratogaWX
JennyLeez wrote:Hi Ken,
re WU-forecast.php
Brilliant Brilliant Brilliant :clap:
Your ML fix for short labels is great, better than it was before. All lays out tidy once again.
The ML version is fine as the stand alone as well :)
Many many thanks for the time you have put into this.
Much appreciated by me.
Cheers
Jenny
Wow! Thanks for the kind words, Jenny. :oops:
And... you're very welcome!

I'm very pleased the ML version works well on your site. The main differences between the SA and ML versions is in handling of the conversion from UTF-8 to target character set (using the PHP iconv() function) and automatic resizing for wide/narrow template aspects. With English, there's shouldn't be an issue as ISO-8859-1 (Latin1) characters are the default.

Best regards,
Ken

Re: Now available: AJAX/PHP multilingual website templates

Posted: Wed 14 Sep 2011 7:00 pm
by josebp
saratogaWX wrote:Ok, this is very strange.

Your forecast URL from WU (the one used by the script) is http://espanol.wunderground.com/global/ ... 08391.html and right now, that page is showing the same as that displayed by the script.

What URL are you using to view the Seville forecast on WU if it is not the same one as above?

Best regards,
Ken

Hi Ken, though I have changed the address to this:
http://espanol.wunderground.com/cgi-bin ... 00.1.08391

Continued use of the Sevilla-LEZL forecast.

Is there any way to fix a problem or WU?

Thanks for your help.
Best regards,
José
-----------------------------------------------------------------------------------------------------------------------
Hola Ken, aunque he cambiado la dirección a esta:
http://espanol.wunderground.com/cgi-bin ... 00.1.08391

Sigue utilizando la previsión de Sevilla-LEZL.

¿Hay alguna manera de arreglarlo o es problema de WU?

Gracias por tu ayuda.
Saludos,
José

Re: Now available: AJAX/PHP multilingual website templates

Posted: Wed 14 Sep 2011 7:15 pm
by saratogaWX
After doing a http://www.tiempoensevilla.es/wxforecast.php?force=1 , your forecast shows exactly the same as
http://espanol.wunderground.com/cgi-bin ... 00.1.08391 on the WU page.

Just have to reload the cache after you change the default URL to get the WU-forecast.php back in sync :)

Best regards,
Ken

Re: Now available: AJAX/PHP multilingual website templates

Posted: Wed 14 Sep 2011 7:31 pm
by josebp
saratogaWX wrote:After doing a http://www.tiempoensevilla.es/wxforecast.php?force=1 , your forecast shows exactly the same as
http://espanol.wunderground.com/cgi-bin ... 00.1.08391 on the WU page.

Just have to reload the cache after you change the default URL to get the WU-forecast.php back in sync :)

Best regards,
Ken
Edit.- The 21:47 and has come to switch to the Sevilla-LEZL forecast :bash:
Desesperante....
------------------------------------------------------------------------------------
Hi Ken, I changed on 20:30, Spain time , and nothing ... :bash:
I deleted the cache files ... and nothing ... :bash:
Use http://www.tiempoensevilla.es/wxforecast.php?force=1... and nothing :bash:
I write the post and soon begins to operate. :lol:
To go crazy.
Thank you very much for your patience.

Best regards,
José
-----------------------------------------------------------------
Hola Ken, lo cambié sobre las 20:30, hora de España, y nada...
Borré los archivos de la caché...y nada...
Utilizé http://www.tiempoensevilla.es/wxforecas ... orce=1...y nada
Escribo el post y al rato empieza a funcionar.
Para volverse loco.
Muchas gracias por tu paciencia.
Saludos,
José

Re: Now available: AJAX/PHP multilingual website templates

Posted: Wed 14 Sep 2011 9:27 pm
by saratogaWX
I think it is really a WeatherUnderground issue.

I look at your WU url http://espanol.wunderground.com/cgi-bin ... 00.1.08391 and sometimes I see it is for: Sevilla (LEZL) and sometimes it is for Sevilla-San Bernardo, Sevilla

Try changing the Settings.php URL for WU to be http://espanol.wunderground.com/cgi-bin ... =IALSEVIL4 and see if that forces it to use the one you want.

Best regards,
Ken

note that that location says it is 'Tomares, España' .. I hope that is what you want.

Re: Now available: AJAX/PHP multilingual website templates

Posted: Wed 14 Sep 2011 9:37 pm
by saratogaWX
Another small change to the WU-forecast.php (ML) to address two things:
1) removal of <? CHANCE OF PRECIP ?> invalid HTML from the forecast text (so the page now validates)
2) handling translation for 'Chance of precip.' in addition to the 'Chance of precipitation' already handled.

Download: WU-forecast.php (ML) Version 1.21 14-Sep-2011 for old WD/PHP/World-ML or V3 Base-World template set)

Best regards,
Ken

Re: Now available: AJAX/PHP multilingual website templates

Posted: Thu 15 Sep 2011 2:01 am
by WoodburyMan
Just wondering how the function to display "Feels Like" works. Earlier today when it was about 82.8F and some humidity, it was displaying a "Feels Like" value of 96F. However.. my records show today's Heat Index only going to 85.8F, and Apparent Temperature only going as high as 89.4F. What value was this displaying?

I looked around and saw in some files it uses Heat Index, Wind Chill and Apparent temperature somehow but I'm not do adapt in PHP to figure out what exactly it was doing, or how it could somehow come up with the 96F reading. Likewise is there a way I can eliminate Apparent Temperature from being used in "Feels Like" function? (I feel it always reports to high of a temperature and feel Heat Index is more accurate, at least for me personally and would like for it to either display Heat Index or Wind Chill only). While I'm at it to, is there a way for Feels Like to display tenths of a digit? (Ex. 89.4F instead of 84F)

Re: Now available: AJAX/PHP multilingual website templates

Posted: Thu 15 Sep 2011 7:05 am
by vpokroglo
Ken, You are genious! With latest cu-defs and tags update You have resolved all issues with european dates dd.mm.yyyy (dot separator)!

Re: Now available: AJAX/PHP multilingual website templates

Posted: Thu 15 Sep 2011 6:57 pm
by saratogaWX
WoodburyMan wrote:Just wondering how the function to display "Feels Like" works. Earlier today when it was about 82.8F and some humidity, it was displaying a "Feels Like" value of 96F. However.. my records show today's Heat Index only going to 85.8F, and Apparent Temperature only going as high as 89.4F. What value was this displaying?

I looked around and saw in some files it uses Heat Index, Wind Chill and Apparent temperature somehow but I'm not do adapt in PHP to figure out what exactly it was doing, or how it could somehow come up with the 96F reading. Likewise is there a way I can eliminate Apparent Temperature from being used in "Feels Like" function? (I feel it always reports to high of a temperature and feel Heat Index is more accurate, at least for me personally and would like for it to either display Heat Index or Wind Chill only). While I'm at it to, is there a way for Feels Like to display tenths of a digit? (Ex. 89.4F instead of 84F)
I discovered a small bug in how the Cumulus-plugin and the ajaxCUwx.js handle the 'feelslike' temperature.

The PHP in CU-defs.php set the $feelslike based on temperature, humidity and heat-index, and the ajaxCUwx.js sets it based on temperature, humidity and humidex, so the number is likely to change when the AJAX cuts in as the humidex is different from heat-index.

I'm making a change to ajaxCUwx.js to replace

Code: Select all

        // FeelsLike
        temp = cTempToC(realtime[2]); // note.. temp in C
        if (temp <= 16.0 ) {
		  feelslike = cTempToC(realtime[24]); //use WindChill
		} else if (temp >=27.0) {
		  feelslike = cTempToC(realtime[42]); //use Humidex 
		} else {
		  feelslike = temp;   // use temperature
		}
		var feelslike  = Math.round(convertTempC(feelslike));
        set_ajax_obs("ajaxfeelslike",feelslike + uomTemp);
		// # mike challis added heatColorWord feature
		var heatColorWord = heatColor(realtime[2],realtime[24],realtime[42]); 
		set_ajax_obs("ajaxheatcolorword",heatColorWord);
with

Code: Select all

        // FeelsLike
        temp = cTempToC(realtime[2]); // note.. temp in C
        if (temp <= 16.0 ) {
		  feelslike = cTempToC(realtime[24]); //use WindChill
		} else if (temp >=27.0) {
		  feelslike = cTempToC(realtime[41]); //use Heat Index
		} else {
		  feelslike = temp;   // use temperature
		}
		var feelslike  = Math.round(convertTempC(feelslike));
        set_ajax_obs("ajaxfeelslike",feelslike + uomTemp);
		// # mike challis added heatColorWord feature
		var heatColorWord = heatColor(realtime[2],realtime[24],realtime[41]);
		set_ajax_obs("ajaxheatcolorword",heatColorWord);
so the AJAX update will match the PHP for source values used.

The apparent temperature reported by Cumulus uses the Australian BOM calculation for it's value. Even though the current CU-defs.php assigns the Cumulus apparent temperature to the $feelslike value, it is overridden by

Code: Select all

list($feelslike,$heatcolourword) = CU_setFeelslike ($temperature,$windch,$heati,$uomtemp);
further on in the code which overrides the $feelslike = $WX['apptemp'];

Since the feelslike temperature is an estimate only, I don't recommend changing it to display a fractional digit and it's unlikely to make much difference in how it feels.. is 89.4 really perceived as that much more than 89 ?

BTW.. I know our Canadian friends prefer use of Humidex so I'll try working up a mod for their defs/AJAX that allows them to use Humidex instead of heat-index for their feelslike display.

Best regards,
Ken

Re: Now available: AJAX/PHP multilingual website templates

Posted: Thu 15 Sep 2011 6:58 pm
by saratogaWX
vpokroglo wrote:Ken, You are genious! With latest cu-defs and tags update You have resolved all issues with european dates dd.mm.yyyy (dot separator)!
Thanks for the kind words! :oops:
I'm glad the fixes worked for your date format.

Best regards,
Ken

Re: Now available: AJAX/PHP multilingual website templates

Posted: Thu 15 Sep 2011 10:16 pm
by beteljuice
The apparent temperature reported by Cumulus uses the Australian BOM calculation for it's value. Even though the current CU-defs.php assigns the Cumulus apparent temperature to the $feelslike value, it is overridden by
Code:
list($feelslike,$heatcolourword) = CU_setFeelslike ($temperature,$windch,$heati,$uomtemp);
further on in the code which overrides the $feelslike = $WX['apptemp'];
So are you saying that you have a function to specifically change Cumulus 'feels like', and if so, is it optional ?

Thinking further along, for all users of your code ....
User 'feels like' Options to be ..
  • Station set
    'Saratoga' reasoning
    Austrailian BOM reasoning

Re: Now available: AJAX/PHP multilingual website templates

Posted: Fri 16 Sep 2011 12:07 am
by WoodburyMan
saratogaWX wrote:
WoodburyMan wrote:Just wondering how the function to display "Feels Like" works. Earlier today when it was about 82.8F and some humidity, it was displaying a "Feels Like" value of 96F. However.. my records show today's Heat Index only going to 85.8F, and Apparent Temperature only going as high as 89.4F. What value was this displaying?

I looked around and saw in some files it uses Heat Index, Wind Chill and Apparent temperature somehow but I'm not do adapt in PHP to figure out what exactly it was doing, or how it could somehow come up with the 96F reading. Likewise is there a way I can eliminate Apparent Temperature from being used in "Feels Like" function? (I feel it always reports to high of a temperature and feel Heat Index is more accurate, at least for me personally and would like for it to either display Heat Index or Wind Chill only). While I'm at it to, is there a way for Feels Like to display tenths of a digit? (Ex. 89.4F instead of 84F)
I discovered a small bug in how the Cumulus-plugin and the ajaxCUwx.js handle the 'feelslike' temperature.

The PHP in CU-defs.php set the $feelslike based on temperature, humidity and heat-index, and the ajaxCUwx.js sets it based on temperature, humidity and humidex, so the number is likely to change when the AJAX cuts in as the humidex is different from heat-index.

I'm making a change to ajaxCUwx.js to replace

Code: Select all

        // FeelsLike
        temp = cTempToC(realtime[2]); // note.. temp in C
        if (temp <= 16.0 ) {
		  feelslike = cTempToC(realtime[24]); //use WindChill
		} else if (temp >=27.0) {
		  feelslike = cTempToC(realtime[42]); //use Humidex 
		} else {
		  feelslike = temp;   // use temperature
		}
		var feelslike  = Math.round(convertTempC(feelslike));
        set_ajax_obs("ajaxfeelslike",feelslike + uomTemp);
		// # mike challis added heatColorWord feature
		var heatColorWord = heatColor(realtime[2],realtime[24],realtime[42]); 
		set_ajax_obs("ajaxheatcolorword",heatColorWord);
with

Code: Select all

        // FeelsLike
        temp = cTempToC(realtime[2]); // note.. temp in C
        if (temp <= 16.0 ) {
		  feelslike = cTempToC(realtime[24]); //use WindChill
		} else if (temp >=27.0) {
		  feelslike = cTempToC(realtime[41]); //use Heat Index
		} else {
		  feelslike = temp;   // use temperature
		}
		var feelslike  = Math.round(convertTempC(feelslike));
        set_ajax_obs("ajaxfeelslike",feelslike + uomTemp);
		// # mike challis added heatColorWord feature
		var heatColorWord = heatColor(realtime[2],realtime[24],realtime[41]);
		set_ajax_obs("ajaxheatcolorword",heatColorWord);
so the AJAX update will match the PHP for source values used.

The apparent temperature reported by Cumulus uses the Australian BOM calculation for it's value. Even though the current CU-defs.php assigns the Cumulus apparent temperature to the $feelslike value, it is overridden by

Code: Select all

list($feelslike,$heatcolourword) = CU_setFeelslike ($temperature,$windch,$heati,$uomtemp);
further on in the code which overrides the $feelslike = $WX['apptemp'];

Since the feelslike temperature is an estimate only, I don't recommend changing it to display a fractional digit and it's unlikely to make much difference in how it feels.. is 89.4 really perceived as that much more than 89 ?

BTW.. I know our Canadian friends prefer use of Humidex so I'll try working up a mod for their defs/AJAX that allows them to use Humidex instead of heat-index for their feelslike display.

Best regards,
Ken
Thanks for the info Ken! I've modified my files accordingly. However I doubt I'll be having any more days where heat index is being used, yesterday was the last I bet. Doesn't look like we'll be breaking out of the 60F's in the next week at least.. Fall is here. Time for some good windchill values now!

Also a neat feature I added to one of my pages I thought I'd share. For those interested in watching the sky's at night I added a clear sky chart to my astronomy page. http://www.grudzien.us/wxastronomy.php. I had to expand the style sheets to a width of 875 vs 800 for it to fit right.

Also sent some beer money your way! Thanks again!