[Plugin: WeatherWidget] convert google weather API to celcius
-
For some reason the google weather API only provides a celcius option for the current temperature, not the forecast?
the weatherwidget script picks up the correct units F/C for your location but if your country uses celcius then it will still show farenheit for the forecast.
I added a bit of code to roughly convert the temperatures in the forecast sections.
its these two lines here:
‘low’ => (($this->sliceOut($match, ‘<low data=”‘, ‘”‘)-32)*0.5). $deg,
‘high’ => (($this->sliceOut($match, ‘<high data=”‘, ‘”‘)-32)*0.5). $deg,its not the most accurate conversion but it seems to do the trick.
not sure if this problem is same for all C countries but might help if you’re stuck.
- The topic ‘[Plugin: WeatherWidget] convert google weather API to celcius’ is closed to new replies.