bom-weather icon indicating copy to clipboard operation
bom-weather copied to clipboard

Weather from the Australian Bureau of Meteorology

h1. BOMWeather

Weather from the Australian Bureau of Meteorology (BOM)

h2. Usage

To get the weather forecast, there are a few options:

  1. Getting a location by name
    BOMWeather::Location.find({ :location => "NAME" })
  2. Getting a location by BOM location id
    BOMWeather::Location.find({ :loc_id => "ID" })
  3. Getting a whole state's weather forecasts
    BOMWeather::Location.find({ :state => "STATE" })

    This takes state's in abbreviated form (e.g. WA, NSW, VIC)

Provided this finds a location (or locations), you will get an array of Location objects.

You can then get access to the forecast information:

loc = BOMWeather::Location.find({ :location => "NAME" })
loc.first.outlook

This returns an array of Forecast objects, each of which have the following accessible methods

max_temp

min_temp

conditions

forecast_date (a Time object)

issue_time