The monthly Inkscape PLC meeting transcripts are a way for those who can’t make the meeting to keep up with what is happening on the backend of the project. We don’t discuss a lot of development or marketing, those are done by separate teams, but just the business-y stuff. We have our meeting using the Inkscape Rocketchat server and then I download the logs and put them in the PLC Git repo. There it is put in a standard IRC log format (we did the meetings in IRC before we had Rocketchat) and rendered to HTML. You can see all the meeting transcripts listed on the Wiki page. While not super special, I’ve done it for a while and I don’t think how I do it has been posted anywhere. This blog post is solely to reduce the bus factor, hopefully no one will need it.

First step is to get the logs as JSON files using Rocketchat History Downloader. I’m not doing anything really special there, I’m executing it like: pipenv run python export-history.py settings.cfg. In my settings I’ve configured my login along with pointing it at the Inkscape Rocketchat server. The other settings I’ve left at default. Probably room for optimization, but I’m only running once a month. For me all the history files are then in the history-files directory.

The next step is to turn the JSON into something similar to an IRC log. This is more trickey than it sounds and I’ve ended up with a small little shell script based on jq that I use to turn the JSON into an IRC log:

jq '.messages[]|(.ts|capture("(?<date>.*)\\.[0-9]+Z$").date+"Z"|fromdate|strftime("%Y-%m-%dT%H:%M:%S"))+" <"+ if .alias then .alias else .u.username end +"> "+.msg' | sed -e "s|^.||" -e "s|.$||" -e "s|\\\\\"|\"|g" | sort

It does a number of things. It reformats the date to match the IRC format. It handles the alias that is used by the Inkscape IRC bot for IRC users in the chat. It handles all the quoting and quoting of quoting that the JSON/jq pipeline gives it. And it sorts by the timestamp (which the downloader doesn’t and I find weird). I’m not going to go through the whole thing but you should ready the jq documentation if you’re curious about the individual items.

And that’s it folks. Not super hard but I wanted to make sure it was documented somewhere.


posted Sep 9, 2022 | permanent link