Zend Framework 1 Service class to interact with wunderground weather api
PHP
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
library/Service/Weather
tests
.gitignore
.project
.travis.yml
README.md
composer.json

README.md

Service_Weather_Wunderground Build Status

Zend_Service component to interact with Wunderground Weather API

Requirements

  • PHP >= 5.3
  • Zend Framework 1.11+

Getting Started

The easiest way to work with this package is when it's installed as a Composer package inside your project. Composer isn't strictly required, but makes life a lot easier.

If you're not familiar with Composer, please see http://getcomposer.org/.

  1. Add php-resque to your application's composer.json.

    {
        ...
        "require": {
            "aporat/service_weather_wunderground": "dev-master"
        },
        ...
    }
    
  2. Run composer install.

  3. If you haven't already, add the Composer autoload to your project's initialization file. (example)

    require 'vendor/autoload.php';
    

Quick Example

<?php

$apiKey = 'ABC';

require 'vendor/autoload.php';

$weatherService = new Service_Weather_Wunderground($apiKey);
$weatherService->setCache($cache);

try {
  $forecast = $weatherService->forecast('US', 'New York', 'New York City');
} catch (Zend_Exception $e) {
  echo $e->getMessage();
}

try {
  $forecast = $weatherService->forecast('Canada', '', 'Ontario');
} catch (Zend_Exception $e) {
  echo $e->getMessage();
}