Weather & Currency

Retrieve live weather conditions and currency exchange rates. Both are fetched from external data sources on each call.

WEATHER

WEATHER "city" SET ?var returns an object describing current conditions for that city.

Field Description
locationCity name resolved by the data source
temp_cTemperature in Celsius
temp_fTemperature in Fahrenheit
descriptionCondition summary, e.g. "Partly cloudy"
humidityRelative humidity, percent
wind_kphWind speed, kilometers per hour
wind_mphWind speed, miles per hour
Current weather for a city
WEATHER "Cape Town" SET ?w
AFTER EMIT ?w("location") & ": " & ?w("temp_c") & "°C, " & ?w("description")
Multi-city weather, fetched in parallel
WEATHER "Cape Town" SET ?cpt
AND WEATHER "London" SET ?lon
AND WEATHER "New York" SET ?nyc
AFTER EMIT "CT: " & ?cpt("temp_c") & "°C | LDN: " & ?lon("temp_c") & "°C | NYC: " & ?nyc("temp_c") & "°C"

CURRENCY

CURRENCY RATE FROM "..." TO "..." SET ?var returns the exchange rate as a plain number. CURRENCY CONVERT n FROM "..." TO "..." SET ?var returns the converted amount as a plain number. Both accept decimal values.

Get an exchange rate
CURRENCY RATE FROM "USD" TO "ZAR" SET ?rate
AFTER EMIT "1 USD = " & ?rate & " ZAR"
Convert an amount
CURRENCY CONVERT 11.45 FROM "USD" TO "ZAR" SET ?amount
AFTER EMIT ?amount
Multi-currency comparison, fetched in parallel
CURRENCY RATE FROM "USD" TO "ZAR" SET ?zar
AND CURRENCY RATE FROM "USD" TO "EUR" SET ?eur
AND CURRENCY RATE FROM "USD" TO "GBP" SET ?gbp
AFTER EMIT "ZAR: " & ?zar & " | EUR: " & ?eur & " | GBP: " & ?gbp