[Модуль] OpenWeatherMap (openweather) Не актуально!
Модератор: immortal
Re: Модуль - Погода от OpenWeatherMap
Приветствую!
На сколько я понял вариантов получить погоду сейчас нет никаких? или я не верно понял?
Хоть с какого нить сервиса
Спасибо
На сколько я понял вариантов получить погоду сейчас нет никаких? или я не верно понял?
Хоть с какого нить сервиса
Спасибо
-
- Сообщения: 19
- Зарегистрирован: Сб апр 23, 2016 10:42 am
- Благодарил (а): 3 раза
- Поблагодарили: 1 раз
Re: Модуль - Погода от OpenWeatherMap
У них теперь авторизация, надо php скрипт чуть допилить. Тока сначала там зарегится и получить appkey
Raspberry Pi 3
-
- Сообщения: 16
- Зарегистрирован: Пн янв 09, 2017 1:52 am
- Благодарил (а): 4 раза
- Поблагодарили: 0
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
-
- Сообщения: 19
- Зарегистрирован: Сб апр 23, 2016 10:42 am
- Благодарил (а): 3 раза
- Поблагодарили: 1 раз
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
-
- Сообщения: 392
- Зарегистрирован: Чт сен 25, 2014 5:37 pm
- Откуда: Екатеринбург
- Благодарил (а): 25 раз
- Поблагодарили: 52 раза
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
- Рейтинг: 1.16%
Re: Модуль - Погода от OpenWeatherMap
Всем привет.
Моя проблема уже была описана... нету выбора страны и городов, таблица OPENWEATHER_CITY девственно пуста... API есть.
Может кто поделится дампом этой таблицы? Или вариантом решения...
Моя проблема уже была описана... нету выбора страны и городов, таблица OPENWEATHER_CITY девственно пуста... API есть.
Может кто поделится дампом этой таблицы? Или вариантом решения...
-
- Сообщения: 364
- Зарегистрирован: Вс янв 15, 2017 5:34 pm
- Откуда: Москва
- Благодарил (а): 100 раз
- Поблагодарили: 53 раза
Re: Модуль - Погода от OpenWeatherMap
Появился недавно конфликт модуля OpenWeather и Онлайн радио, при обновлении погоды включается одна и та же радио станция (причем не важно обновлять в ручную или через onNewHour). После удаления модуля Онлайн радио, каждое обновление модуля OpenWeather ругается на отсутствие Онлайн радио. Не подскажите что может мешать их союзу?
Raspberry Pi3 - Broadlink - MegaD - Много датчиков - Камеры - Часы.
Connect
Connect