Grab the weather forecast using weatherapi.com
I like to record the weather in my journals. For several years, I’ve used https://wttr.in via curl. Recently, wttr is often unreachable or throws errors, so I took a look at weatherapi.com
Designed for developers by developers, Weather API is the ultimate weather and geolocation API
The free account limits are generous, so I created an account. The default JSON results are very thorough. I created a little shell script that uses jq to parse the JSON and returns only the high/low temps and a text summary of the forecast:
#!/bin/sh
# Jack Baty, 2023 (https://baty.net)
jq=/opt/homebrew/bin/jq
weatherfile=
condition=
high=
low=
The output looks like this:
Low 52.1, High 72.6 – Patchy rain possible
Easy enough. I wrote a small lisp function that calls the script and inserts the weather in Emacs: