Every morning, emails one briefing on today's conditions and the days ahead for each place you list.
Uses
Gmail
OpenWeatherMap
Morning weather briefing for the places you follow
Every morning at 07:00, the current conditions and the five-day forecast are read for each place you list, and one briefing lands in your inbox. Each place gets today's reading, with conditions, temperature, humidity and wind, followed by one line per day ahead giving the temperature range, the sky, the highest chance of precipitation and the strongest gusts.
Days that cross the rain or wind thresholds you choose, or that have snow in the forecast, are marked with the reason and listed together at the top, so the awkward days are visible at a glance. The briefing reports what the forecast says and nothing more. A place the weather service cannot resolve does not cost you the rest: the others are reported as normal and the unreadable one is named at the bottom so you can correct it. Only if none can be read does the run stop without sending.
locations to blank.Set locations to blank.recipient to blank.Set recipient to blank.units to metric.Set units to metric.rainChancePercent to 50.Set rainChancePercent to 50.windGustThreshold to 12.Set windGustThreshold to 12.temperatureUnit to °C.Set temperatureUnit to °C.windUnit to m/s.Set windUnit to m/s.units is imperialIf units is imperialtemperatureUnit to °F.Change temperatureUnit to °F.windUnit to mph.Change windUnit to mph.units is standardIf units is standardtemperatureUnit to K.Change temperatureUnit to K.locations by ; and save it as places.Split locations by ; and save it as places.sections.Start an empty list and save it as sections.unreadable.Start an empty list and save it as unreadable.flaggedDays.Start an empty list and save it as flaggedDays.place in places:For each place in places:place and save it as placeName.Trim place and save it as placeName.placeName is emptyIf placeName is emptylookupErrorIf a step below fails, save the error as lookupErrornow.Get the current weather. Save it as now.forecast.Get the 5-day forecast. Save it as forecast.heading to placeName.Set heading to placeName.now.location isn't emptyIf now.location isn't emptynow.location isn't emptyIf now.location isn't emptyheading to now.location.Change heading to now.location.nowLine to Now: .Set nowLine to Now: .now.conditions isn't emptyIf now.conditions isn't emptynow.conditions isn't emptyIf now.conditions isn't emptynowLine to nowLine@now.conditions, .Change nowLine to nowLine@now.conditions, .now.temperature isn't emptyIf now.temperature isn't emptynowLine to nowLine plus now.temperature rounded to the nearest integer plus temperatureUnit.Change nowLine to nowLine plus now.temperature rounded to the nearest integer plus temperatureUnit.now.feels_like isn't emptyIf now.feels_like isn't emptynowLine to nowLine (feels like now.feels_like rounded to the nearest integer@temperatureUnit).Change nowLine to nowLine (feels like now.feels_like rounded to the nearest integer@temperatureUnit).now.humidity isn't emptyIf now.humidity isn't emptynowLine to nowLine, humidity now.humidity rounded to the nearest integer%.Change nowLine to nowLine, humidity now.humidity rounded to the nearest integer%.now.wind_speed isn't emptyIf now.wind_speed isn't emptynowLine to nowLine, wind now.wind_speed rounded to the nearest integer windUnit.Change nowLine to nowLine, wind now.wind_speed rounded to the nearest integer windUnit.nowLine is Now: If nowLine is Now: nowLine to Now: no current reading was returned for this location..Change nowLine to Now: no current reading was returned for this location..steps to forecast.entries.Set steps to forecast.entries.forecastDays.Start an empty list and save it as forecastDays.entry in steps:For each entry in steps:entry.time contains T If entry.time contains Tentry.time split by T to the end of forecastDays and save it as forecastDays.Add the first item of entry.time split by T to the end of forecastDays and save it as forecastDays.forecastDays and save it as forecastDays.Remove duplicates from forecastDays and save it as forecastDays.dayLines.Start an empty list and save it as dayLines.day in forecastDays:For each day in forecastDays:dayLow to nothing. Set dayLow to nothing.dayHigh to nothing. Set dayHigh to nothing.dayChance to -1. Set dayChance to -1.dayGust to -1. Set dayGust to -1.dayHeadline to blank. Set dayHeadline to blank.daySnow to blank. Set daySnow to blank.entry in steps: For each entry in steps:entry.time split by T is day If the first item of entry.time split by T is dayentry.temperature isn't emptyIf entry.temperature isn't emptydayLow is emptyIf dayLow is emptydayLow to entry.temperature.Change dayLow to entry.temperature.dayHigh is emptyIf dayHigh is emptydayHigh to entry.temperature.Change dayHigh to entry.temperature.entry.temperature is less than dayLowIf entry.temperature is less than dayLowdayLow to entry.temperature.Change dayLow to entry.temperature.entry.temperature is greater than dayHighIf entry.temperature is greater than dayHighdayHigh to entry.temperature.Change dayHigh to entry.temperature.entry.precipitation_probability isn't emptyIf entry.precipitation_probability isn't emptyentry.precipitation_probability is greater than dayChanceIf entry.precipitation_probability is greater than dayChancedayChance to entry.precipitation_probability.Change dayChance to entry.precipitation_probability.entry.conditions isn't emptyIf entry.conditions isn't emptydayHeadline to entry.conditions.Change dayHeadline to entry.conditions.entry.wind_gust isn't emptyIf entry.wind_gust isn't emptyentry.wind_gust is greater than dayGustIf entry.wind_gust is greater than dayGustdayGust to entry.wind_gust.Change dayGust to entry.wind_gust.entry.condition_group is SnowIf entry.condition_group is SnowdaySnow to yes.Change daySnow to yes.dayName to blank. Set dayName to blank.dateError If a step below fails, save the error as dateErrorday and save it as dayName.Get the day of the week for day and save it as dayName.dayLabel to day. Set dayLabel to day.dayName isn't empty If dayName isn't emptydayLabel to dayName day.Change dayLabel to dayName day.dayParts. Start an empty list and save it as dayParts.dayLow isn't empty If dayLow isn't emptydayHigh isn't emptyIf dayHigh isn't emptydayLow rounded to the nearest integer is dayHigh rounded to the nearest…If dayLow rounded to the nearest integer is dayHigh rounded to the nearest…dayLow rounded to the nearest integer plus temperatureUnit to the end of dayParts and save it as dayParts.Add dayLow rounded to the nearest integer plus temperatureUnit to the end of dayParts and save it as dayParts.dayLow rounded to the nearest integer to dayHigh rounded to the nearest integer@temperatureUnit to the end of dayParts and save it as dayParts.Add dayLow rounded to the nearest integer to dayHigh rounded to the nearest integer@temperatureUnit to the end of dayParts and save it as dayParts.dayHeadline isn't empty If dayHeadline isn't emptydayHeadline to the end of dayParts and save it as dayParts.Add dayHeadline to the end of dayParts and save it as dayParts.dayChance is greater than or equal to 0 If dayChance is greater than or equal to 0dayChance multiplied by 100 rounded to the nearest integer% chance of precipitation to the end of dayParts and save it as dayParts.Add dayChance multiplied by 100 rounded to the nearest integer% chance of precipitation to the end of dayParts and save it as dayParts.dayGust is greater than or equal to 0 If dayGust is greater than or equal to 0dayGust rounded to the nearest integer windUnit to the end of dayParts and save it as dayParts.Add gusts to dayGust rounded to the nearest integer windUnit to the end of dayParts and save it as dayParts.dayLine to dayLabel: no readings were returned for this day. Set dayLine to dayLabel: no readings were returned for this day.dayParts isn't empty If dayParts isn't emptydayLine to dayLabel: dayParts joined by , .Change dayLine to dayLabel: dayParts joined by , .dayFlags. Start an empty list and save it as dayFlags.dayChance is greater than or equal to 0 If dayChance is greater than or equal to 0dayChance multiplied by 100 is greater than or equal to rainChancePercentIf dayChance multiplied by 100 is greater than or equal to rainChancePercenthigh chance of precipitation to the end of dayFlags and save it as dayFlags.Add high chance of precipitation to the end of dayFlags and save it as dayFlags.dayGust is greater than or equal to 0 If dayGust is greater than or equal to 0dayGust is greater than or equal to windGustThresholdIf dayGust is greater than or equal to windGustThresholdstrong gusts to the end of dayFlags and save it as dayFlags.Add strong gusts to the end of dayFlags and save it as dayFlags.daySnow is yes If daySnow is yessnow in the forecast to the end of dayFlags and save it as dayFlags.Add snow in the forecast to the end of dayFlags and save it as dayFlags.dayFlags isn't empty If dayFlags isn't emptydayLine to dayLine [dayFlags joined by ; ].Change dayLine to dayLine [dayFlags joined by ; ].heading day to the end of flaggedDays and save it as flaggedDays.Add heading day to the end of flaggedDays and save it as flaggedDays.dayLine to the end of dayLines and save it as dayLines. Add dayLine to the end of dayLines and save it as dayLines.section to headingSet section to heading
nowLine.dayLines isn't emptyIf dayLines isn't emptysection to sectionChange section to section
Next five days:
- dayLines joined by
- .section to sectionChange section to section
No forecast steps were returned for the days ahead.section to the end of sections and save it as sections.Add section to the end of sections and save it as sections.placeName to the end of unreadable and save it as unreadable.Add placeName to the end of unreadable and save it as unreadable.placeName: lookupError as text.Show in the output: Could not read the weather for placeName: lookupError as text.sections is emptyIf sections is emptyfailureMessage to No briefing was sent: none of the locations could be read. Check the 'locations' step - list places separated by semicolons, for example 'Berlin,DE; Lisbon,PT; 94103,US'..Set failureMessage to No briefing was sent: none of the locations could be read. Check the 'locations' step - list places separated by semicolons, for example 'Berlin,DE; Lisbon,PT; 94103,US'..unreadable isn't emptyIf unreadable isn't emptyfailureMessage to failureMessage Could not read: unreadable joined by , .Change failureMessage to failureMessage Could not read: unreadable joined by , .failureMessage.Stop and report a problem: failureMessage.briefing to Morning weather briefing.Set briefing to Morning weather briefing.flaggedDays isn't emptyIf flaggedDays isn't emptybriefing to briefingChange briefing to briefing
Days above your thresholds: flaggedDays joined by ; .briefing to briefingChange briefing to briefing
No days above your thresholds in the next five days.briefing to briefingChange briefing to briefing
sections joined by a blank line.unreadable isn't emptyIf unreadable isn't emptybriefing to briefingChange briefing to briefing
Could not read: unreadable joined by , . Check the spelling, or add a country code - for example 'Springfield,US'.briefing to briefingChange briefing to briefing
Thresholds: precipitation chance at or above rainChancePercent%, gusts at or above windGustThreshold windUnit.subject to Morning weather briefing.Set subject to Morning weather briefing.flaggedDays isn't emptyIf flaggedDays isn't emptysubject to subject - the length of flaggedDays day(s) above your thresholds.Change subject to subject - the length of flaggedDays day(s) above your thresholds.recipient.Send an email to recipient.
Subject: subjectbriefing