Copyright | (c) 2015 Devan Stormont |
---|---|
License | BSD-style |
Maintainer | stormont@gmail.com |
Stability | experimental |
Portability | GHC |
Safe Haskell | None |
Language | Haskell2010 |
This module builds a URI endpoint which can be used to download data from Forecast.io.
For official documentation, see: Forecast.io, version 2. Please start with this documentation for information about the general service; it's quite detailed.
The usage of this module is quite simple. For example, to get an endpoint for London:
buildUri $ mkForecastEndpoint { feCoord = GPS 51.5072 0.1275, feApiKey = "YOUR-API-KEY" }
General usage is to generate a URI of the form: https://api.forecast.io/forecast/APIKEY/LATITUDE,LONGITUDE
- class Endpoint a where
- data Exclude
- data ForecastEndpoint = ForecastEndpoint {}
- data GPS = GPS {}
- data Units
- mkForecastEndpoint :: ForecastEndpoint
- mkGPS :: GPS
Documentation
A class that can generate a URI endpoint from an instance of type a
.
A definition for a data segment to exclude from the results. If everything is excluded, little useful data will be returned.
data ForecastEndpoint Source
A data type for defining a Forecast.io endpoint.
The supported list of languages is defined by the forecast.io documentation.
The feExtend
record, when set, will cause a more fine-grained
request URI for hourly weather forecast data to be generated.
A class that contains GPS data about a location.
Defines the units in which the data is returned in. Units_US
is the default behavior when omitted.
mkForecastEndpoint :: ForecastEndpoint Source
Generates a default ForecastEndpoint
object. At a minimum, you'll
want to override the feCoord
and feApiKey
records.