/forecast-clojure

Clojure library for retrieving data from the Forecast API

Primary LanguageClojure

forecast-clojure

A Clojure library for retrieving data from the forecast.io API.

Installation

forecast-clojure is available as a Maven artifact from Clojars:

[forecast-clojure "1.0.4"]

Configuration

The library fetches your forecast.io API key from the environment using Environ. You can set your key in one of two ways.

In ~/.lein/profiles.clj:

{:user {:env {:forecast-key "insert-your-api-key-here"}}}

Or, set it as an environment variable:

FORECAST_KEY=insert-your-api-key-here

Usage

(require '[forecast-clojure.core :refer :all])

(forecast "37.8267" "-122.423")
(forecast "37.8267" "-122.423" :time 1362974400)
(forecast "37.8267" "-122.423" :params {:units "si" :exclude "daily,alerts" :callback "..."})

Please refer to the forecast.io API documentation for information on the full response properties.

License

Copyright © 2013 J.D. Hollis

Distributed under the Eclipse Public License, the same as Clojure.