[Модуль] OpenWeatherMap (openweather) Не актуально!
Модератор: immortal
Re: Модуль - Погода от OpenWeatherMap
Приветствую!
На сколько я понял вариантов получить погоду сейчас нет никаких? или я не верно понял?
Хоть с какого нить сервиса
Спасибо
На сколько я понял вариантов получить погоду сейчас нет никаких? или я не верно понял?
Хоть с какого нить сервиса
Спасибо
Re: Модуль - Погода от OpenWeatherMap
У меня всё работает, никаких проблем нет
Re: Модуль - Погода от OpenWeatherMap
Действительно странно, у меня море ошибок и не работает.
Re: Модуль - Погода от OpenWeatherMap
У них теперь авторизация, надо php скрипт чуть допилить. Тока сначала там зарегится и получить appkey
Raspberry Pi 3
Re: Модуль - Погода от OpenWeatherMap
Напиши подробней, пожалуйста, что допилить надо?
Re: Модуль - Погода от OpenWeatherMap
Как сделать, чо бы модуль заработал ? на сайте зарегистрировался, код ввел и все равно ошибки
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
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
У меня другой видать модуль.
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
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
Raspberry Pi 3
Re: Модуль - Погода от OpenWeatherMap
Пол часика подожди, ключ дают но он еще не активен...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
Всем привет.
Моя проблема уже была описана... нету выбора страны и городов, таблица OPENWEATHER_CITY девственно пуста... API есть.
Может кто поделится дампом этой таблицы? Или вариантом решения...
Моя проблема уже была описана... нету выбора страны и городов, таблица OPENWEATHER_CITY девственно пуста... API есть.
Может кто поделится дампом этой таблицы? Или вариантом решения...
Re: Модуль - Погода от OpenWeatherMap
Появился недавно конфликт модуля OpenWeather и Онлайн радио, при обновлении погоды включается одна и та же радио станция (причем не важно обновлять в ручную или через onNewHour). После удаления модуля Онлайн радио, каждое обновление модуля OpenWeather ругается на отсутствие Онлайн радио. Не подскажите что может мешать их союзу?