PHPackages                             yahooweather/weather - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. yahooweather/weather

ActivePackage[Utility &amp; Helpers](/categories/utility)

yahooweather/weather
====================

A simple package to Get yahoo weather created By PHPAnonymous

69.3k3[3 issues](https://github.com/arabnewscms/yahooweather/issues)PHP

Since Apr 24Pushed 8y ago2 watchersCompare

[ Source](https://github.com/arabnewscms/yahooweather)[ Packagist](https://packagist.org/packages/yahooweather/weather)[ RSS](/packages/yahooweather-weather/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

YahooWeather
============

[](#yahooweather)

A simple package to Get Yahoo weather by using YQL created By PHPAnonymous

Table of Contents
=================

[](#table-of-contents)

1. [Installation](#installation)
2. [Usage](#usage)
3. [Example Controller](#example-controller)

Installation
------------

[](#installation)

1. Using composer: `composer require yahooweather/weather:dev-master `
2. Add the Provider class to your `config/app.php` file

```
   YahooWeather\Weather\PHPAnonymousYahooWeather::class,
```

3. Add this line to the the aliases array

```
        'YahooWeather' => YahooWeather\Weather\AnonyControllerYahooWeather::class,
```

Usage
-----

[](#usage)

4. In your controller, make sure to add the following line:

```
use YahooWeather;
```

5. Use the `YahooWeather` Class. It takes two parameters, a country and a language.

```
 YahooWeather::Country('egypt','ar');
```

The result is returned as a JSON array:

```
{"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"}
```

```
 // 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:

[](#example-controller)

```
