Difference between revisions of "MythWeather Grabber Script Format"
(add required datatypes) |
|||
Line 6: | Line 6: | ||
== Current Conditions == | == Current Conditions == | ||
+ | * cclocation | ||
+ | * relative_humidity | ||
+ | * pressure | ||
+ | * wind_spdgst | ||
+ | * wind_dir | ||
+ | * visibility | ||
+ | * appt | ||
+ | * temp | ||
+ | * weather | ||
+ | * weather_icon | ||
+ | * observation_time | ||
+ | * copyright | ||
== Three Day Forecast == | == Three Day Forecast == | ||
+ | * 3dlocation | ||
+ | * date-0 through date-2 | ||
+ | * icon-0 through icon-2 | ||
+ | * low-0 through low-2 | ||
+ | * high-0 through high-2 | ||
+ | * updatetime | ||
== Six Day Forecast == | == Six Day Forecast == | ||
+ | * 6dlocation | ||
+ | * date-0 through date-5 | ||
+ | * icon-0 through icon-5 | ||
+ | * high-0 through high-5 | ||
+ | * low-0 through low-5 | ||
<!-- | <!-- | ||
== Today's Forecast == | == Today's Forecast == | ||
− | + | * header | |
+ | * updatetime | ||
+ | * today-desc | ||
--> | --> | ||
== Static Map == | == Static Map == | ||
+ | * smdesc | ||
+ | * updatetime | ||
+ | * map | ||
== Animated Map == | == Animated Map == | ||
+ | * amdesc | ||
+ | * updatetime | ||
+ | * animatedimage | ||
== Severe Weather Alerts == | == Severe Weather Alerts == | ||
+ | * swlocation | ||
+ | * alerts | ||
== 18 Hour Forecast == | == 18 Hour Forecast == | ||
+ | * 18hrlocation | ||
+ | * time-0 through time-5 | ||
+ | * 18icon-0 through 18icon-5 | ||
+ | * temp-0 through temp-5 | ||
+ | * pop-0 through pop-5 | ||
+ | * updatetime | ||
<!-- | <!-- | ||
== Tomorrow's Outlook == | == Tomorrow's Outlook == | ||
− | + | * forecastdate | |
+ | * tempforecast | ||
+ | * condforecast | ||
+ | * todaypic | ||
+ | * updatetime | ||
+ | * location | ||
--> | --> | ||
Revision as of 17:13, 28 March 2010
MythWeather grabber scripts are small executable perl, python, or binary applications which query online sources of weather and return it in a format parseable by MythWeather. This page documents the current format required of the grabber scripts to function.
Contents
Data Types
MythWeather has six different types of pages. Grabbers are categorized into these types by the data they specify as capable of providing. Grabbers can seamlessly provide data for multiple pages by making sure to meet all the requirements for each.
Current Conditions
- cclocation
- relative_humidity
- pressure
- wind_spdgst
- wind_dir
- visibility
- appt
- temp
- weather
- weather_icon
- observation_time
- copyright
Three Day Forecast
- 3dlocation
- date-0 through date-2
- icon-0 through icon-2
- low-0 through low-2
- high-0 through high-2
- updatetime
Six Day Forecast
- 6dlocation
- date-0 through date-5
- icon-0 through icon-5
- high-0 through high-5
- low-0 through low-5
Static Map
- smdesc
- updatetime
- map
Animated Map
- amdesc
- updatetime
- animatedimage
Severe Weather Alerts
- swlocation
- alerts
18 Hour Forecast
- 18hrlocation
- time-0 through time-5
- 18icon-0 through 18icon-5
- temp-0 through temp-5
- pop-0 through pop-5
- updatetime
Commands
The Version Command (-v)
All grabber scripts must return an identifying string when run with the '-v' argument. The command returns a comma separated list of the script name, script version, author, and author's email, and output must end with a newline character.
#./bbccurrentxml.pl -v BBC-Current-XML,0.2,Stuart Morgan,stuart@tase.co.uk
The Timeout Command (-T)
All grabber scripts must return two timeout values when run with the '-T' argument. The command returns a comma separated list of information lifetime, and web response timeout, in seconds.
#./bbccurrentxml.pl -T 7200,30
The Field List Command (-t)
All grabber scripts must return a list of available data fields, one per line, when run with the '-t' argument.
#./bbccurrentxml.pl -t cclocation station_id copyright observation_time weather temp relative_humidity wind_dir pressure visibility weather_icon appt wind_spdgst
The Location Search Command (-l <location>)
All grabber scripts must return a list of possible location matches, one per line, when run with the '-l' argument. The matches are an identifying string to be used with the data string, and a description, separated by a double colon.
#./bbccurrentxml.pl -l Cincinnati 407::Cincinnati, Ohio 3231::Cincinnati/Northern Kentucky International, Kentucky
The Data Command (-u <unit system> -d <folder> <location string>)
The data command includes a mandatory unit system, and provides a directory path with full read/write access. The location will be that provided by the '-l' command, and the unit system will be one of 'SI' or 'ENG'. The directory can be used to store temporary data or cache results, or can be silently ignored. Data is returned, one value per line, separated from the identifying string by a double colon.
#./bbccurentxml.pl -u ENG 407 appt::NA copyright::From bbc.co.uk station_id::407 cclocation::Cincinnati, United States of America observation_time::Thursday at 13:00 EST weather::Grey cloud weather_icon::cloudy.png temp::43 wind_dir::E wind_spdgst::9 (NA) relative_humidity::65 pressure::30.5321117 visibility::10-20
Valid Data Types
cclocation | Descriptive name of location | Text |
relative_humidity | Percent humidity | Integer |
pressure | Barometric pressure | Float |
wind_spdgst | Wing speed (gust) | Integer |
wind_dir | Wind direction | Cardinal |
visibility | Integer/Range | |
appt | ||
temp | ||
weather | ||
weather_icon | ||
observation_time | ||
copyright | ||
3dlocation | ||
6dlocation | ||
date-<n> | ||
icon-<n> | ||
low-<n> | ||
high-<n> | ||
updatetime | ||
18icon-<n> | ||
temp-<n> | ||
pop-<n> | ||
swlocation | ||
alerts | can have multiple lines | |
forecastdate | ||
tempforecast | ||
condforecast | ||
todaypic | ||
location |
} |