Existence-bot

One of my pet projects is a telegram bot that asks me a few questions every day about the past day and thus collects some personal statistics.

In particular, among the questions there is an item about my current location - so on this site appears information about what city I am in with a delay of no more than one day.

Idea

About two years ago, on a cold winter evening in St. Petersburg, I got depressed and thought that it was because the evening was cold, winter and St. Petersburg. And it was more fun to live in summer, but that's not for sure. The next day I created a telegram bot, which every evening asks me a series of questions about the past day.

Questions from the category of whether I slept well, whether I was physically active, what will be the goal for the next day, whether today's goal was accomplished, and so on. At the end, a short sammarie and a subjective evaluation of the day on a scale of 1-10. In general, I had a hypothesis that in winter and summer I would have very different evaluations, and this would be a good reason in favor of changing my place of residence to a sunnier one, for example.

Implementation

The base of the bot was written in one evening in Python, using the python-telegram-bot framework and deployed to a private server. The data is poured into a MongoDB database. The record of each day is a simple structure of id, date fields and a dictionary with my answers. To minimize the time for data entry, for most questions I provide buttons for quick answer: Yes / No. To get the location, the bot actually asks to send geolocation, which is further converted from coordinates into a readable record with the help of geopy library. Again, to simplify the process, the bot will first ask if I am in the same place where I was yesterday and only in case of a negative answer it will ask to send geolocation directly in the Telegram interface.

Screenshot 1 Screenshot 2

Result

After a year, the averaged evaluations showed that my mood (and these numbers can be interpreted in this way) does not depend on the season. Well, the bot remained and I gradually added some more metrics, improved the output of statistics, etc.

Why is this necessary? The question is a good one 😂 First of all, the very process of filling out such a "diary", which takes about a minute, is a way to reflect a bit on the day. And I accumulate a kind of puddle of personal data that can be entertaining to pick at.

For example:

  • Map the points I've been to in a month/year.
  • Count the number of days I've spent in different countries. Could be useful for understanding when tax residency changes.
  • How many days a year I read books (lol)
  • Get out a short sammari for each day of the past month and look back at it.
  • Quickly remember what I was doing on February 24
  • etc.