YaWeather
Parser Weather from Yandex Weather, (*1)
, (*2)
, (*3)
Installation
git clone https://github.com/ignatenkovnikita/parserYandexWeather.git
cd parserYandexWeather
composer update
OR
composer require ignatenkovnikita/ya-weather
After this, run index.php from your web browser., (*4)
Demo
You can test program from this page, (*5)
API
Simple usage, (*6)
require_once($_SERVER['DOCUMENT_ROOT'] . '/parserYandexWeather/vendor/autoload.php');
use YaWeather\YaWeather;
$cityId = 27643; // List of Town https://pogoda.yandex.ru/static/cities.xml
$parser = new YaWeather($cityId);
$parser->load(); // load xml
$parser->show(); // get html as pogoda.yandex
$parser->logFormat(); // get error & success AS string
var_dump($parser->getResult()); // Get Object City with Cities
Testing
For unit testing just run command from root directory of the project:, (*7)
vendor/bin/phpunit test\