Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arabnewscms/yahooweather
A simple package to Get yahoo weather by using yql created By PHPAnonymous
https://github.com/arabnewscms/yahooweather
Last synced: 2 months ago
JSON representation
A simple package to Get yahoo weather by using yql created By PHPAnonymous
- Host: GitHub
- URL: https://github.com/arabnewscms/yahooweather
- Owner: arabnewscms
- License: mit
- Created: 2016-09-19T22:15:11.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-24T15:48:32.000Z (over 6 years ago)
- Last Synced: 2024-10-12T21:11:48.088Z (3 months ago)
- Language: PHP
- Size: 9.77 KB
- Stars: 6
- Watchers: 3
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# YahooWeather
A simple package to Get Yahoo weather by using YQL created By PHPAnonymous# Table of Contents
1. [Installation](#installation)
2. [Usage](#usage)
3. [Example Controller](#example-controller)## Installation
1. Using composer: `composer require yahooweather/weather:dev-master `2. Add the Provider class to your `config/app.php` file
```php
YahooWeather\Weather\PHPAnonymousYahooWeather::class,
```3. Add this line to the the aliases array
```php
'YahooWeather' => YahooWeather\Weather\AnonyControllerYahooWeather::class,
```## Usage
4. In your controller, make sure to add the following line:
```php
use YahooWeather;
```5. Use the `YahooWeather` Class. It takes two parameters, a country and a language.
```php
YahooWeather::Country('egypt','ar');
```The result is returned as a JSON array:
```php
{"high":"30","low":"18","image":"http:\/\/l.yimg.com\/a\/i\/us\/we\/52\/32.gif","name":"egypt","description":"\n\nCurrent Conditions:\nSunny\n\n\nForecast:\n Mon - Mostly Sunny. High: 30Low: 18\n Tue - Sunny. High: 32Low: 18\n Wed - Partly Cloudy. High: 33Low: 18\n Thu - Partly Cloudy. High: 33Low: 19\n Fri - Mostly Sunny. High: 33Low: 20\n\n\n\n\n\n\n\n"}
```
```php
// high | العظمي
// low | الصغري
// name | country name / اسم الدولة
// image | image status frequency | حالة الطقس بالصورة
// description | other details | تفاصيل اخري
$weather = YahooWeather::Country('egypt','ar');
echo $weather['high'];
echo $weather['low'];
echo $weather['image'];
echo $weather['name'];
echo $weather['description'];
```### Example Controller:
```php