I just added a Blog stats page to this site, which features a live dashboard that shows how many posts and words are in this blog. (Yes, meta.)
This dashboard was in part inspired by two things I came across:
- Jim Collins' system for tracking his "creative hours", with a goal of hitting 1000 hours per year. (Picked up from this excellent podcast episode with Tim Ferris.) => This made me think: if I want to get better at writing, I ought to track some metric.
- A parable from the book Art & Fear about a ceramics teacher who split the class into two groups: 1) a group who would be graded solely on the quality of a single pot they made, and 2) a group that would be graded solely on the quantity—in pure weight—of pots they made. The higher the quantity, the higher the grade. At the end of the semester, ironically the "quantity" group had the highest-quality pots. Thus: the importance of putting in the reps. (citation) => This made me seek to track input/effort metrics in particular.
How I built the dashboard
In short, there were three main steps:
- Creating the UI. I kept it simple. This UI is just three Containers, 4 Statistics, and 1 Table component in Retool.
- Pulling in the blog post content using the API. This was one HTTP call to the Ghost Content API.
How this dashboard could be improved
This was a quick and dirty first draft, but enough to get me off the ground. It took less than 20 minutes, from start to finish, to build.
There are definitely things that could be better:
- Expand the set of stats I'm showing. I might want to break down how many words I'm writing in different categories (like personal, versus collaboration systems).
- Data fetching. Right now, I don't have enough blog posts to need to paginate the fetch from the Ghost API. But with enough work, I will. This is easy to do.
- Crunch the stats offline. Right now, the stats of computed on the fly in the app when you load it. Another option is to fetch the data and compute the statistics "offline", rather than in the app.
- A smarter word count. Right now, I'm doing a simple
.split(' ').length(as you can see from the code snippets above). This isn't a perfect word count algorithm, especially when parsing HTML. But good enough for an MVP.
Hopefully, as I write more, I'll need to solve some of these problems.