Added some activity graphs to this ( linked off my about page ). Currently they just look at activity on a set of gitlab servers I use. I’m going to try and add github later. And then maybe raid some other data sources.
Just a quick explanation of how I did it.
First I wrote a program to connect to gitlab servers and grab activity events. The meat of it is this:
Yes, it even includes a
goto - the horrors. It’s cleaner than any
other way I can think of to skip out when I’ve got all the data I need.
Other modules that fetch activity will generate the same JSON structure. These all then get pulled together with a summary module also written in Go:
Now every year exists in a
data/activity/sumYYYY.json file. All that’s needed is to
display the data in the about page. This is done with hugo shortcode:
There are some issues though. It seems that gitlab has some sort of limit to the activities it will track. My personal gitlab server only goes back 18 months. The gitlab.com server has activity going back to 2016 (clearly not much) so not sure what setting I need to do to extend mine.
Obviously if I make more than 100 actions in a day I’ll blow past my colour range - which, in another issue, is kind of lacking variation past 50 contributions. That seems like a lot but if my history on my personal server went back further it would include a bunch of stuff I did in digitising documents with git-annex (which was an annoying dead-end).