nyeholt/silverstripe-weatherforecast

Retrieve a weather forecast (uses openweather)

Installs: 4 160

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 3

Open Issues: 0

Language:HTML

Type:silverstripe-module

dev-master / 1.0.x-dev 2016-07-20 07:19 UTC

This package is auto-updated.

Last update: 2024-03-29 02:39:32 UTC


README

Usage

In your project .yml config

---
Name: weather-config
After: weatherforecast/*
---
Injector:
  OpenWeatherService:
    properties:
      key: {your key here}

From your code, call the following. The LocationID will need to be looked up from the openweather site.

Requirements::css('weatherforecast/owfonts/css/owfont-regular.min.css');
$forecast = singleton('OpenWeatherService')->forecastFor($locationID);

PLEASE NOTE

The requirements of OpenWeatherMaps mean you must provide attribution on your site for using the service.