Weather info not refreshing

444 views
Skip to first unread message

Stan

unread,
Jun 9, 2016, 2:08:28 PM6/9/16
to Stalker Middleware
Hi all,

I have problem with refresh of weather info since May 23.

Can someone provide working link of weather data for the weather module of stalker?

Thanks

bubantus

unread,
Jun 15, 2016, 9:58:39 AM6/15/16
to Stalker Middleware
Подтверждаю, погода больше не обновляется.
Message has been deleted

Ivan Tushev

unread,
Jun 29, 2016, 10:11:42 AM6/29/16
to Stalker Middleware
If you are using OPENWEATHERMAP - they have integrated API KEY requirement since a while ago. What you need to do is go to their website, make an account and get the API KEY (you will need it in the code snippets below - just replace the PASTE_YOUR_PERSONAL_API_KEY_HERE text with your catual API KEY).
Then make the following changes in the MWS portal (as of this writing version is 5.0.1):

in stalker_portal/server/lib/openweathermap.class.php on line 172:
        $url = 'http://api.openweathermap.org/data/2.5/group?id='.implode(',', $ids).'&units=metric';
change to:
        $url = 'http://api.openweathermap.org/data/2.5/group?id='.implode(',', $ids).'&units=metric&APPID=PASTE_YOUR_PERSONAL_API_KEY_HERE';

in stalker_portal/server/lib/openweathermap.class.php on line 356:
        $url = 'http://api.openweathermap.org/data/2.5/forecast?id='.$id.'&units=metric';
change to:
        $url = 'http://api.openweathermap.org/data/2.5/forecast?id='.$id.'&units=metric&APPID=PASTE_YOUR_PERSONAL_API_KEY_HERE';

That's it! On next crontab refresh you should get your updated weather information :)

nikolai atanasov

unread,
Jul 1, 2016, 5:24:11 AM7/1/16
to Stalker Middleware

Privet stavili 5.0.1 versia posle etava pagoda usla zdelal to sto napisali pramenial eta stalker_portal/server/lib/
openweathermap.class.php on line 172: i eta stalker_portal/server/lib/
openweathermap.class.php on line 356: api key vzial vot zdes https://openweathermap.org
no vsioravno pagoda netu v apache takaya ashibka not found in /var/www/html/stalker_portal/server/common.php on line 38,
kak mojna eta izpravit spasiba

Ivan Tushev

unread,
Jul 1, 2016, 6:12:52 AM7/1/16
to Stalker Middleware
I think your problem is with default_timezone setting.
Please go to http://php.net/manual/en/timezones.europe.php and find a timezone suitable for your location (example: Europe/Sofia if you are from Bulgaria) and make sure you have the following setting in server/custom.ini:
default_timezone = Europe/Sofia

On my stalker I've also setup weather_provider and default_openweathermap_city_id. You can go to http://openweathermap.org/find and search for a city (example: Sofia). Then select the city from the reasults and you will notice that the address bar of the browser is: http://openweathermap.org/city/727011 - the last digits are the city_id you are looking for.

Today I've found out that there is also another setting provided by MWS that may be the correct solution for APPID, without the need to edit stalker_portal/server/lib/openweathermap.class.php - but I have not tested if it will work correctly. You may remove the modifications and set in custom.ini:
openweathermap_appid = 'YOUR_API_KEY'

Please let me know if it works, if you test it.

So, to sum it up, you will need the folloing configuration in server/custom.ini (NOTE: those settings are for Sofia, Bulgaria):
[l18n]
default_timezone
= Europe/Sofia

[weather]
weather_provider
= openweathermap
default_openweathermap_city_id
= 727447
openweathermap_appid
= 'PASTE_YOUR_OPENWEATHERMAP_API_KEY_HERE'

Hope it helped!
-Ivan

nikolai atanasov

unread,
Jul 1, 2016, 6:16:19 AM7/1/16
to Stalker Middleware
Balshoe spasiba palucilas tenks
Reply all
Reply to author
Forward
0 new messages