https://github.com/ignatenkovnikita/parseryandexweather
Parser Weather from Yandex Pogoda
https://github.com/ignatenkovnikita/parseryandexweather
Last synced: 3 months ago
JSON representation
Parser Weather from Yandex Pogoda
- Host: GitHub
- URL: https://github.com/ignatenkovnikita/parseryandexweather
- Owner: ignatenkovnikita
- License: mit
- Created: 2015-08-23T22:17:07.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-03-28T16:32:14.000Z (about 9 years ago)
- Last Synced: 2025-02-03T13:31:31.838Z (5 months ago)
- Language: CSS
- Size: 313 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# YaWeather
Parser Weather from Yandex Weather[](https://packagist.org/packages/ignatenkovnikita/ya-weather)
[](https://packagist.org/packages/ignatenkovnikita/ya-weather)
[](https://packagist.org/packages/ignatenkovnikita/ya-weather)
[](https://packagist.org/packages/ignatenkovnikita/ya-weather)[](https://travis-ci.org/ignatenkovnikita/parserYandexWeather)
[](https://www.versioneye.com/user/projects/56729494107997003e0005ec)
[](https://scrutinizer-ci.com/g/ignatenkovnikita/parserYandexWeather/?branch=master)
[](https://codecov.io/github/ignatenkovnikita/parserYandexWeather?branch=master)
[](http://hhvm.h4cc.de/package/ignatenkovnikita/ya-weather)
[](https://codeclimate.com/github/ignatenkovnikita/parserYandexWeather)## Installation
```sh
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.## Demo
You can test program from [this page](http://dv.ignatenkovnikita.ru/parserYandexWeather/)## API
Simple usage```php
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 stringvar_dump($parser->getResult()); // Get Object City with Cities
```
## Testing
For unit testing just run command from root directory of the project:
```sh
vendor/bin/phpunit test\
```