Inspired by https://lornajane.net/posts/2019/the-first-thousand-blog-posts from Lorna Mitchell back in April on completing 1000 blog posts, and then more recently https://revdancatt.com/weeknotes/2019/11/15/001-not-weeknotes by Rev Dan Catt on (not starting) weeknotes, I’m working on a plan for my own weeknote posts. I’m defining a weeknotes post as a curated collection of either “things I’ve learnt” or “interesting things I’ve seen” this week. The Rev Dan Catt gave me the clue how to start this:

…I’ve just finished listening to “Storyworthy” a book about, well, telling stories. I’m not keen on the “Engage, Teach and Persuade” part of the tagline, nor the life-changing part to be honest. But in the book, Matthew Dicks talks about spotting things that happen throughout the day that could be considered storyworthy. He suggests that at the end of each day, try and think of one thing that happened that could be the seed of a story. Then put that into a spreadsheet. Each day, every day. Like an ultra-brief journal. Then you can go back later and see which ones stand out as a potential tale. Perhaps that works for weeknotes too.

This gave me the idea to store my Candidate Weeknote Thoughts (CWT) in a google sheet, but I wanted the process of adding them to be as frictionless as possible. I explored various automation options, which didn’t really do what I wanted, and then came across https://github.com/kren1/tosheets, which allows you to send entries to Google Sheets from a command line. It’s pretty easy to set up, and requires authorisation from google sheets the first time it’s run. You pass it the ID for a sheet, which you can get from the URL- it’s the long string of letters and numbers at the end. Google seems to think it’s not particularly secure, according to the security settings on my account, so don’t use it to store sensitive information m’kay?

Firstly I set up a spreadsheet called “whatIlearnedtoday”. Then I had to figure out the command I’d need to send a dated CWT to the it. This took a bit of guesswork on my part, but eventually I came up with the following:

echo $(date '+%Y-%m-%d') : "text I want to send" | tosheets -c a1 --spreadsheet=[idformyspreadsheet] -q '"' -d ':'

This sends a date in a nice tidy YYYY-MM-DD format, followed by a colon, followed by the text I want to send as my note, surrounded by double-quotes, to the tosheets command, which forwards it to the spreadsheet I have chosen, with the string quote (the -q parameter) and the delimiter (the -d parameter) specified.

I chose a colon as the delimiter as it’s something I’m likely to use in a CWT than a semi-colon or a comma. Pipe symbols (|) were out as well because that might confuse the echo command.

That’s great, and it works as it is, but remembering that command, or even retrieving it from my bash history is hardly frictionless. So I wrapped the command in a little bash script that takes the configuration value (at present just the spreadsheet id) from an included config file. Then the command is simplified to the following:

.\bash-weeknotes.sh "text I want to send as my CWT"

I’ve generally got a bash prompt open, so I can add my CWT with virtually no friction or break of flow. The general idea is that I will review the spreadsheet every week (maybe), or at least semi-regularly, and use the entries as an aide memoire for a weeknotes post. I don’t plan any futher automation of this process as I’m not a bot.

Obviously the next step was to throw this up onto GitHub, so here you are:

https://github.com/archaeogeek/bash-weeknotes

As an aside- I have, for a number of years, used https://github.com/oscardelben/sheet to store code snippets from the command line. It’s another tool that sits well within my workflow, but I wanted something that would also help me blog regularly again. Perhaps in future I will investigate combining the two.