2017 © Pedro Peláez
 

package weather

A simple package to Get yahoo weather created By PHPAnonymous

image

yahooweather/weather

A simple package to Get yahoo weather created By PHPAnonymous

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 1 Versions
  • 11 % Grown

The README.md

YahooWeather

A simple package to Get Yahoo weather by using YQL created By PHPAnonymous, (*1)

Table of Contents

  1. Installation
  2. Usage
  3. Example Controller

Installation

  1. Using composer: composer require yahooweather/weather:dev-master, (*2)

  2. Add the Provider class to your config/app.php file, (*3)

   YahooWeather\Weather\PHPAnonymousYahooWeather::class,
  1. Add this line to the the aliases array
        'YahooWeather' => YahooWeather\Weather\AnonyControllerYahooWeather::class,

Usage

  1. In your controller, make sure to add the following line:
use YahooWeather;
  1. 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:, (*4)

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"}, (*5)

```php // high | العظمي // low | الصغري // name | country name / اسم الدولة // image | image status frequency | حالة الطقس بالصورة // description | other details | تفاصيل اخري, (*6)

$weather = YahooWeather::Country('egypt','ar'); echo $weather['high']; echo $weather['low']; echo $weather['image']; echo $weather['name']; echo $weather['description'];
```, (*7)

Example Controller:

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use YahooWeather;
class WeatherController extends Controller
{
    public function get_weather(){
        $weather = YahooWeather::Country('lebanon','ar');
        var_dump($weather);
    }
}

For more advanced queries, you can use the custom query function:, (*8)

php $weather = YahooWeather::YQL('Your Query Here'); dd($weather);, (*9)

Check the Yahoo YQL Console for more information on YQL queries: https://developer.yahoo.com/yql/console, (*10)

That's it :), (*11)

Enjoy, (*12)

The Versions

24/04 2018

dev-master

9999999-dev http://phpanonymous.com

A simple package to Get yahoo weather created By PHPAnonymous

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

laravel lumen yahoo weather phpanonymous yql phpanonymous.com