SP Weather module updated with new API and performance boost - JoomShaper

SP Weather module updated with new API and performance boost

30 January 2019
Hits 7,482
3 min read
SP Weather module updated with new API and performance boost

There is an English proverb “A ring around the sun or moon, means that rain will come real soon”. The nature is full of mystery. Weather is one of its most fickle elements. The ancient human being used to observe the surrounding signs to predict the weather. But today, you don’t have to look here and there. Weather update is now at your fingertips through lots of tools available on different platforms.

For Joomla websites, we have the SP Weather module to show the weather updates and forecasts on board. And today is a good sunny day for all of the SP Weather users. Because the module has just got an important update. Let’s check what’s new in SP Weather v2.3 starting with the changelog.

SP Weather v2.3 changelog

  • Update: Introduced OpenWeatherMap API
  • Update: Dropped Yahoo Weather API
  • Update: Caching improved
  • Update: Performance improved

New OpenWeatherMap API

The SP Weather module was originally based on Yahoo Weather API. Recently, we have been receiving user reports that the Yahoo Weather API unexpectedly causes errors and the forecasts go offline. You put the module on your site to show weather information to the visitors, but if they don’t get it, that will turn out to be a bad UX. With today’s update, we’ve solved this problem.

The Yahoo API has been dropped and replaced with the new OpenWeatherMap API. The latest one has a good reputation and track record of stability and service. Most importantly, you will no longer face the issues you’ve been experiencing.  

SP Weather module updated with new API and performance boost

SP Weather Demo: The weather is now awesome. Enjoy your time!

How to use OpenWeatherMap API?

Step 1: At first visit the official OpenWeatherMap registration page and signup for an API key. After logging-in to your user account there, you will see an API keys tab on the dashboard. Click that, and copy your API key.

SP Weather module updated with new API and performance boost

Step 2: Login to your Joomla site’s admin control panel. Click Modules on the left. Find the SP Weather module in the list appeared. Click SP Weather, and that will take you to its backend. There you will find the API KEY field to enter your OpenWeatherMap API key. Paste the API key (which you’ve just got in the step 1) in the API KEY field and save.

SP Weather module updated with new API and performance boost

You can also adjust the module settings to modify the appearance of the weather update information on your site.

Along with the weather API update, we've improved the caching system and overall performance of the SP Weather module. Try yourself to feel the change.  

Good to know

The SP Weather module helps you display the current weather condition and forecasts on a Joomla site for a given city. You can set the city name, translated name of the location, weather status, humidity, wind condition, forecast and so on.

The forecast display can be customized using options like block/list layouts, number of forecast days, separator, temperature unit etc. The module has a cache functionality that makes the weather condition loading faster. The cache cleans automatically at a preset interval.

I’m really excited about the SP Weather update that will bring the weather information back to all of the Joomla sites that use this module. Kudos to our R&D team for the update. Please let us know your feedback and suggestions. Thank you!

Live Demo    Free Download SP Weather Rate on JED

Arafat Bin Sultan

Arafat Bin Sultan

Arafat is a tech-enthusiast with a keen interest in space, photography, and video making.

Comments (56)

I
infoParigi.it
This comment was minimized by the moderator on the site

Great job, now is working ok!

Rifat Wahid Alif
Rifat Wahid Alif    infoParigi.it
This comment was minimized by the moderator on the site

Thanks for using SP Weather.

SA
Schlittler Andreas
This comment was minimized by the moderator on the site

sorry It don't work -

see all parameters and error message

see given parameters on

https://glnachrichten.schlittler.net/httpdocs/images/2019/01/31/openweather_not_work1.png

https://glnachrichten.schlittler.net/httpdocs/images/2019/01/31/openweather_not_work4.png

https://glnachrichten.schlittler.net/httpdocs/images/2019/01/31/openweather_not_work3.png

https://glnachrichten.schlittler.net/httpdocs/images/2019/01/31/openweather_not_work2.png

so WHAT's the CASE??

Thank You for analize that. I waste a lot of time

Rifat Wahid Alif
Rifat Wahid Alif    Schlittler Andreas
This comment was minimized by the moderator on the site

Hi,
I have tried your location in my localhost. It's working perfectly. Could you please Make sure that your server does allow fopen and cURL?
Here are my screenshots:
1. http://prntscr.com/mf6ttj
2. http://prntscr.com/mf6ues

- Thanks

Rifat Wahid Alif
Rifat Wahid Alif    Schlittler Andreas
This comment was minimized by the moderator on the site

Hi,
SP Weather 3.0 is released: here with 5 API platform.

Bob Bishop
Bob Bishop
This comment was minimized by the moderator on the site

Does not work sorry. Why do you need a subscription to access forums for free stuff?

Rifat Wahid Alif
Rifat Wahid Alif    Bob Bishop
This comment was minimized by the moderator on the site

Hi,
Thanks for using SP Weather module. Could you please share your issue what you are facing?

- Thanks

Bob Bishop
Bob Bishop    Rifat Wahid Alif
This comment was minimized by the moderator on the site

I am getting the following


Can't forecast decode data. Also make sure your location is current. Verify your location from here https://openweathermap.org/find


This is on a website based on a UK server but a holiday rental site for Lanzarote. I have checked on open weather and have the correct place name Arrecife, ES

Just not showing the weather

Paul Frankowski
Paul Frankowski    Bob Bishop
This comment was minimized by the moderator on the site

The forum, as you may know, is part of support. We will check your bug on Monday. Thanks for understanding.

Bob Bishop
Bob Bishop    Paul Frankowski
This comment was minimized by the moderator on the site

OK Thanks

RS
Roman Sharipov    Paul Frankowski
This comment was minimized by the moderator on the site

Did you solve this problem?

rsharipov about 3 days ago
I have the same problem (I checked different cities):
Can't current decode data. Also make sure your location is current. Verify your location from here https://openweathermap.org/find

RS
Roman Sharipov
This comment was minimized by the moderator on the site

I have the same problem (I checked different cities):
Can't current decode data. Also make sure your location is current. Verify your location from here https://openweathermap.org/find

S
Stephen    Roman Sharipov
This comment was minimized by the moderator on the site

I've been having the same issue as well.

Rifat Wahid Alif
Rifat Wahid Alif    Stephen
This comment was minimized by the moderator on the site

Hi,
Thanks for using this. Could you please share your city name?

M
merique
This comment was minimized by the moderator on the site

same here

P
peter
This comment was minimized by the moderator on the site

Yes, same problem here. Have verified location on openweathermap. Tried other locations as well. For example "London, UK" does not work. Saw the note about fopen and curl and those are enabled.
Generated a new API key just to be sure... no difference.
Thanks.

Rifat Wahid Alif
Rifat Wahid Alif    peter
This comment was minimized by the moderator on the site

Hi,
SP Weather 3.0 is released: here with 5 API platform.

RS
Rand Schools
This comment was minimized by the moderator on the site

Hi,

I am facing the same issue, pleas update if you have any solution

Rifat Wahid Alif
Rifat Wahid Alif    Rand Schools
This comment was minimized by the moderator on the site

Hi,
SP Weather 3.0 is released: here with 5 API platform.

P
peter
This comment was minimized by the moderator on the site

Ok - seems like the support from JoomShaper is pretty close to zero.
So I did some digging.

The problems is that the module strips out <spaces> from the location string you enter. openweathermap.org does not like that and return unknown location. You can patch it on line #40 in mod_sp_weather/helper.php

orig:
$this->location = str_replace(' ', '', $this->params->get('location', 'Dhaka,BD'));

patch:
$this->location = str_replace(' ', '%20', $this->params->get('location', 'Dhaka,BD'));

It would have been neat if your GitHub repository was updated and I could have done a pull request.
Bu...

Ok - seems like the support from JoomShaper is pretty close to zero.
So I did some digging.

The problems is that the module strips out <spaces> from the location string you enter. openweathermap.org does not like that and return unknown location. You can patch it on line #40 in mod_sp_weather/helper.php

orig:
$this->location = str_replace(' ', '', $this->params->get('location', 'Dhaka,BD'));

patch:
$this->location = str_replace(' ', '%20', $this->params->get('location', 'Dhaka,BD'));

It would have been neat if your GitHub repository was updated and I could have done a pull request.
But you’re welcome.

Read More
RS
Roman Sharipov    peter
This comment was minimized by the moderator on the site

Thank you very much!
But your solution did not solve the problem.

P
peter    Roman Sharipov
This comment was minimized by the moderator on the site

solved my problem

R
RayR    Roman Sharipov
This comment was minimized by the moderator on the site

Didn't work for me either.

P
peter
This comment was minimized by the moderator on the site

BTW - also the constant SP_WEATHER_MODERATE_RAIN is missing from the language file so you would need to create a language override.

There are more issues so this is clearly not a quality product. Like why present temperature with 3 decimals? One is more than enough. It is "m/s" not "METER/SEC" etc.

MMDoege
MMDoege
This comment was minimized by the moderator on the site

We are very happy with OpenWetherMap as it works very well. Of course you have to add an additional qualifier as there many "Londons" or similar cases on this planet. We have never tried Yahoo or others as they often have limitations (eg. only cities in english) (OWM provides a Widget which does not go with our CI policy).

To comply with our spec's we ended up in reading OWM JSON returns as we haven't found someone providing a really nice ready-to-go weather module.

As we are a community platform provider a city id fixed in a module does not make any sense to us. JoomShaper has stopped...

We are very happy with OpenWetherMap as it works very well. Of course you have to add an additional qualifier as there many "Londons" or similar cases on this planet. We have never tried Yahoo or others as they often have limitations (eg. only cities in english) (OWM provides a Widget which does not go with our CI policy).

To comply with our spec's we ended up in reading OWM JSON returns as we haven't found someone providing a really nice ready-to-go weather module.

As we are a community platform provider a city id fixed in a module does not make any sense to us. JoomShaper has stopped here half way. We'ld buy a SP Weather Pro version when city is a variable which we will get from our member's geolocation.

Read More
D
Dimitris
This comment was minimized by the moderator on the site

same problem as the others, with Kerkyra, GR and also tried London, UK etc.

Can't forecast decode data. Also make sure your location is current. Verify your location from here https://openweathermap.org/find


Peter's solution didn't help :/

Rifat Wahid Alif
Rifat Wahid Alif    Dimitris
This comment was minimized by the moderator on the site

Hi,
SP Weather 3.0 is released: here with 5 API platform.

PT
Peter Thomas
This comment was minimized by the moderator on the site

Same here.. J!3.9.3 with SP Weather module v2.3 - followed all instructions and verified location etc., but I get the same error as everyone else. Since updating to the Open Weathermap api, it's stopped working. I've tried re-installing the extension, created a new api key etc., but still no luck.

I appreciate that this is a free extension, but it would be really helpful to everyone, if some kind soul from Joomshaper could kindly respond here with an explanation as to why it's not working.. at least so that we can get it working correctly.

SA
Sfirat Alexandru
This comment was minimized by the moderator on the site

I have solved the problem by disabling forecast.

SA
Sfirat Alexandru    Sfirat Alexandru
This comment was minimized by the moderator on the site

I assume that to use forecast you have to pay subscription.

D
Dimitris    Sfirat Alexandru
This comment was minimized by the moderator on the site

That did the trick!

Rifat Wahid Alif
Rifat Wahid Alif    Dimitris
This comment was minimized by the moderator on the site

Hi,
SP Weather 3.0 is released: here with 5 API platform. The free forecast is also included there.

PT
Peter Thomas    Sfirat Alexandru
This comment was minimized by the moderator on the site

It didn't work for me.. forecast disabled, cleared the cache etc., but still getting the error message

Rifat Wahid Alif
Rifat Wahid Alif    Peter Thomas
This comment was minimized by the moderator on the site

Hi,
SP Weather 3.0 is released: here with 5 API platform.

D
Dimitris
This comment was minimized by the moderator on the site

I haven't checked if SP_WEATHER_MODERATE_RAIN is missing from the text as peter is saying but, "meteocons-cloudy-night" is missing from the css, and the relevant icon is not loading.

Rifat Wahid Alif
Rifat Wahid Alif    Dimitris
This comment was minimized by the moderator on the site

Hi,
SP Weather 3.0 is released: here

R
RayR
This comment was minimized by the moderator on the site

I'm having the same problem - "Can't forecast decode data. Also make sure your location.." but it works if I disable Forecast so it's not that it doesn't recognise the City Name. Any ideas from Joomshaper support?

PT
Peter Thomas    RayR
This comment was minimized by the moderator on the site

Disabling forecast doesn't work for me.. this is so annoying !

RS
Rand Schools
This comment was minimized by the moderator on the site

Im Having the same issue, pleas update us when you find solutions

Rifat Wahid Alif
Rifat Wahid Alif    Rand Schools
This comment was minimized by the moderator on the site

Hi,
SP Weather 3.0 is released: here

A
Alvaro
This comment was minimized by the moderator on the site

Deactivating the forecast works, but the API key must have several hours to be created. I created a key 12 hours ago and that worked, but with the new key I created now for the domain it did not work.

A
Alvaro    Alvaro
This comment was minimized by the moderator on the site

We have verified it, disabling forecast works, but you have to wait at least 15 minutes after creating the KEY. This must depend on the country in which they are located, in some it may be more in others less, or perhaps for all the same. I share the tests that I did.

Rifat Wahid Alif
Rifat Wahid Alif    Alvaro
This comment was minimized by the moderator on the site

Hi,
SP Weather 3.0 is released: here

DM
Dimitris Mitsopoulos
This comment was minimized by the moderator on the site

Hi all,

i had the same problem as everyone here:

"Can't forecast decode data. Also make sure your location is current. Verify your location from here"

I tried to disable the forecast through the module's admin and it did work for me.

However, this is not an acceptable solution...

Has the support team found a way to properly solve this?

Please let us know, because it is not right to offer a module that dysfunctions..

Thank you

Rifat Wahid Alif
Rifat Wahid Alif    Dimitris Mitsopoulos
This comment was minimized by the moderator on the site

Hi,
SP Weather 3.0 is released: here

Rifat Wahid Alif
Rifat Wahid Alif
This comment was minimized by the moderator on the site

Thanks all for the wait, We are giving an update with the fix very soon.

- Thanks

SP Chaudhary
SP Chaudhary
This comment was minimized by the moderator on the site

Can't current decode data. Also make sure your location is current. Verify your location from here https://openweathermap.org/find

Page Error: https://app.box.com/s/5pqjeacdeh7sjqsde8zfwsaeehjx6ms7
SP Weather Setting: https://app.box.com/s/18lw4exxwftm5dcmyv4fit2x23ykv64b

Thanks,
SP Chaudhary

Rifat Wahid Alif
Rifat Wahid Alif    SP Chaudhary
This comment was minimized by the moderator on the site

Hi,
Thanks for the comment, maybe your location will be: Disa, IN (http://prntscr.com/n1iobm).

Bob Bishop
Bob Bishop
This comment was minimized by the moderator on the site

Has this been updated yet so it works?

Rifat Wahid Alif
Rifat Wahid Alif    Bob Bishop
This comment was minimized by the moderator on the site

Hi,
SP Weather 3.0 is released: here

MA
MIHAI ALIN
This comment was minimized by the moderator on the site

hi. any chance to see the temperature as integer number, without decimals ? I mean: 13 not 13,45 ?

Thank you

Carlos Moreira
Carlos Moreira    MIHAI ALIN
This comment was minimized by the moderator on the site

This is a shame.
Nothing works.

Rifat Wahid Alif
Rifat Wahid Alif    MIHAI ALIN
This comment was minimized by the moderator on the site

Sorry for this inconvenience. Could you please paste this code on the following file /modules/mod_sp_weather/mod_sp_weather.php on 118 number line:

$data['query']['results']['channel']['item']['condition']['temp'] = round($data['query']['results']['channel']['item']['condition']['temp']);


We will add this option on the future update.

- Thanks

Carlos Moreira
Carlos Moreira
This comment was minimized by the moderator on the site

How can I display the degrees as integer, without the decimal point and the figures afterwards?

Rifat Wahid Alif
Rifat Wahid Alif    Carlos Moreira
This comment was minimized by the moderator on the site

Hi,
We are sorry for this inconvenience, Could you please try this solution: https://www.joomshaper.com/blog/sp-weather-module-updated-with-new-api-and-performance-boost#comment-9475,8402

- Thanks

M
Miguel Ángel    Carlos Moreira
This comment was minimized by the moderator on the site

Hola.
Después de pelearme bastante, he descubierto cómo redondear la temperatura.
Yo lo he probado con la API de Yahoo, que es la que uso; pero supongo que funcionará con todas.
En el mod_sp_weather, aproximadamente en la línea 112 has de sustituir el código que hay por éste:
} elseif ($platform == 'yahoo') {
$data['query']['results']['channel']['item']['condition']['temp'] = round($helper->tempConvert(round($data['current']->condition->temperature, 'c')), 2);

There are no comments posted here yet

Sign up for our newsletter

Don’t miss any updates of our new templates and extensions and all the astonishing offers we bring for you.