Weather logging in Tinderbox Updated
For the past couple of years, I’ve used a “Stamp” in Tinderbox to append weather conditions to the current note’s text.
See Recording The Weather In Tinderbox for background.
While preparing my Daybook for 2017 I decided I wanted to include just the current condition and temperature rather than the entire weather summary. The following script grabs the weather (using wu) and returns just the condition and temperature.
#!/bin/sh
\# Jack Baty, 2016 ([https://baty.net](https://baty.net))
\# Grab and parse weather info using 'wu' by Stephen Ramsay
\# [https://github.com/sramsay/wu](https://github.com/sramsay/wu)
\# Assumes $GOPATH is set
WEATHER=\`$GOPATH/bin/wu\`
TEMP=\`echo "$WEATHER" | awk '/Temperature/' | cut -d':' -f2-\`
COND=\`echo "$WEATHER" | awk '/Conditions/' | cut -d':' -f2-\`
echo "$COND $TEMP"
My Stamp calls this new script, adds the results to a custom attribute named “Weather” and then adds Weather as a KeyAttribute to the current note. This way the weather is only displayed on notes for which I explicitly asked for it. The new Stamp looks like this:

Now, if I want to include the current weather conditions with any note, I apply the Stamp and it looks like this…

Originally published at baty.net on December 28, 2016.