The Weather package

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain]

Warnings:

Weather is a simple library for interacting with the Weather Underground JSON API. It is not complete, but it may be useful still.


[Skip to ReadMe]

Properties

Versions0.1.0.0, 0.1.0.0, 0.1.0.1, 0.1.0.2, 0.1.0.3, 0.1.0.4
Change logNone available
Dependenciesaeson (>=0.8.0.2), base (>=4.7.0.2 && <5), bytestring (>=0.10.4.0), HTTP (>=4000.2.12), text (>=1.1.0.1), unordered-containers (>=0.2.5.1) [details]
LicenseBSD3
AuthorBryan St. Amour
Maintainerbryan@bryanstamour.com
CategoryWeb
Home pagehttp://bryanstamour.com
UploadedSat Apr 11 13:15:52 UTC 2015 by bstamour

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees

Readme for Weather-0.1.0.0

weather

Haskell library for working with the Weather Underground JSON API.

Currently only supports querying for conditions for US-based cities.

Example usage:

{-# LANGUAGE RecordWildCards #-}

module Main where

import Web.Weather

mykey :: APIKey
mykey   = "top-secret"

mycity, mystate :: String
mycity  = "Detroit"
mystate = "MI"

main :: IO ()
main = do
  resp <- getConditions mykey mycity mystate
  case resp of
   Nothing -> putStrLn "No data for that city/state"
   Just (Observation{..}) -> do
     putStrLn $ "Observation time: " ++ obsTime
     putStrLn $ "Weather conditions: " ++ obsWeather
     putStrLn $ "Temp: " ++ show obsTemp
     putStrLn $ "Rel humidity: " ++ show obsRelHumidity
     putStrLn $ "Wind: " ++ obsWind
     putStrLn $ "Feels like: " ++ obsFeelsLike

Output:

Observation time: Last Updated on April 10, 2:09 PM EDT
Weather conditions: Partly Cloudy
Temp: 52.9
Rel humidity: "60%"
Wind: From the West at 4.7 MPH
Feels like: 52.9 F (11.6 C)