I’ve been using the Habitica Habit Tracker recently and it’s been a really good app to handle all sorts of history tracking. How much water do I drink? How many cigarettes do I smoke per day? Hint: recently very few.
Fortunately Habitica also has an API that lets you work with your entire history programmatically and to display it in every chart you can imagine.
The chart I wanted was to look at the history of how many cigarettes I had smoked per day. If you’re a smoker you probably know that it’s more of a day by day thing how much energy you have to fight the urge of simply going for another smoking break or lighting another cigarette.
Continue reading “Parsing Your Data from the Habitica API”
Parsing JSON is a common task for most developers, currently I’m actually finally getting to write slugofy which is supposed to slugify URLs or URL fragments in Go.
In case you’re wondering, slugs are commonly used to generate URLs from the title of a page. Let’s say we have a page title like the Swedish national dish:
Swedish national dish: köttbullar, we probably don’t want either the special chars like the ö or the : in there. Also we don’t want whitespaces to show up as
%20, so let’s make them dashes instead:
Continue reading “JSON parsing in Golang”