Страница 21 из 55

Re: Модуль - Погода от OpenWeatherMap

Добавлено: Чт янв 12, 2017 1:57 pm
MaxVM
Приветствую!
На сколько я понял вариантов получить погоду сейчас нет никаких? или я не верно понял?

Хоть с какого нить сервиса

Спасибо

Re: Модуль - Погода от OpenWeatherMap

Добавлено: Чт янв 12, 2017 2:04 pm
bat86
У меня всё работает, никаких проблем нет

Re: Модуль - Погода от OpenWeatherMap

Добавлено: Пт янв 13, 2017 2:36 pm
Aranaks
Действительно странно, у меня море ошибок и не работает.

Re: Модуль - Погода от OpenWeatherMap

Добавлено: Пт янв 13, 2017 2:49 pm
smden
У них теперь авторизация, надо php скрипт чуть допилить. Тока сначала там зарегится и получить appkey

Re: Модуль - Погода от OpenWeatherMap

Добавлено: Пт янв 13, 2017 11:20 pm
wildsm
Напиши подробней, пожалуйста, что допилить надо?

Re: Модуль - Погода от OpenWeatherMap

Добавлено: Сб янв 14, 2017 12:20 am
maks_mkv
Как сделать, чо бы модуль заработал ? на сайте зарегистрировался, код ввел и все равно ошибки
Warning: date() expects parameter 2 to be long, string given in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 298

Warning: date() expects parameter 2 to be long, string given in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 299

Warning: gmdate() expects parameter 2 to be long, string given in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 300

Warning: file_get_contents(http://openweathermap.org/img/w/.png): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 422

Warning: date() expects parameter 2 to be long, string given in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 298

Warning: date() expects parameter 2 to be long, string given in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 299

Warning: gmdate() expects parameter 2 to be long, string given in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 300

Warning: file_get_contents(http://openweathermap.org/img/w/.png): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 422

Warning: date() expects parameter 2 to be long, string given in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 298

Warning: date() expects parameter 2 to be long, string given in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 299

Warning: gmdate() expects parameter 2 to be long, string given in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 300

Re: Модуль - Погода от OpenWeatherMap

Добавлено: Сб янв 14, 2017 10:29 am
smden
У меня другой видать модуль.
require_once("./lib/OpenWeather/OpenWeather.php");
Но суть не меняет. Данные вытягиваются функцией

protected static function GetJsonWeatherDataByCityID
($vCityID,
$vUnits = "metric")
{
if (!isset($vCityID)) return null;

$vUnits = OpenWeather::GetUnits($vUnits);
$query = "http://api.openweathermap.org/data/2.5/weather?id=" . $vCityID. "&APPID=твойАППКЕЙ&units=" . $vUnits;
$data = json_decode(file_get_contents($query));

return $data;
}

далее в сценарии

require_once("./lib/OpenWeather/OpenWeather.php"); // Подключаем погодный класс
$weather = new OpenWeather(); // наследуем класс
$curWeather = $weather->GetWeatherByCityID("524901", "metric"); // получаем массив с данными о погоде
$widget = $weather->GetCurrentWeatherWidgetByCityID("524901","metric"); // html код с детализацией о погоде
$temp = $curWeather->main->temp; // берём из массива температуру
setGlobal('ThisComputer.TempOutside', $temp); // обновляем свойства
setGlobal('ThisComputer.weatherFull', $widget); // обновляем свойства
$this->setProperty('tempoutside.Temp',$temp);

ну как-то так.
И на сайте ихнем всё подробно есть http://openweathermap.org/current

Re: Модуль - Погода от OpenWeatherMap

Добавлено: Сб янв 14, 2017 6:01 pm
eygen
maks_mkv писал(а):Как сделать, чо бы модуль заработал ? на сайте зарегистрировался, код ввел и все равно ошибки
Warning: date() expects parameter 2 to be long, string given in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 298

Warning: date() expects parameter 2 to be long, string given in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 299

Warning: gmdate() expects parameter 2 to be long, string given in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 300

Warning: file_get_contents(http://openweathermap.org/img/w/.png): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 422

Warning: date() expects parameter 2 to be long, string given in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 298

Warning: date() expects parameter 2 to be long, string given in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 299

Warning: gmdate() expects parameter 2 to be long, string given in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 300

Warning: file_get_contents(http://openweathermap.org/img/w/.png): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 422

Warning: date() expects parameter 2 to be long, string given in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 298

Warning: date() expects parameter 2 to be long, string given in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 299

Warning: gmdate() expects parameter 2 to be long, string given in C:\_majordomo\htdocs\modules\app_openweather\app_openweather.class.php on line 300
Пол часика подожди, ключ дают но он еще не активен...

Re: Модуль - Погода от OpenWeatherMap

Добавлено: Сб янв 14, 2017 10:14 pm
Sl1ng3R
Всем привет.
Моя проблема уже была описана... нету выбора страны и городов, таблица OPENWEATHER_CITY девственно пуста... API есть.
Может кто поделится дампом этой таблицы? Или вариантом решения...

Re: Модуль - Погода от OpenWeatherMap

Добавлено: Вс янв 15, 2017 6:09 pm
kas5858
Появился недавно конфликт модуля OpenWeather и Онлайн радио, при обновлении погоды включается одна и та же радио станция (причем не важно обновлять в ручную или через onNewHour). После удаления модуля Онлайн радио, каждое обновление модуля OpenWeather ругается на отсутствие Онлайн радио. Не подскажите что может мешать их союзу?