Messenger Data Analysis

A simple browser-based application to aggregate and chart Facebook Messenger data.

Back in 2017 I though it would be interesting to look at my Facebook messages: when I sent them, what my most common words and emojis were, and so on. Initially I wrote a Python script which parsed the HTML data (since that is the only data format Facebook offered at the time), but parsing HTML was very slow and cumbersome to work with, Python was not so great when it came to distributing it to friends and the internet - so I ditched Python. I actually stopped working on it for quite a while after that.

In 2018 I learned a bit more about JavaScript, and decided to revisit the project with the intention of making it a web app. This was made easier by the fact that Facebook now allowed you to download the data in JSON format - something much easier to parse. It was perfect - cross platform, easy to distribute (just host it somewhere, like GitHub pages), and the data processing could still be done locally on the users' own computer - it didn't need to be sent to a server. This last point was very important to me since I didn't need to worry about storing people's data and the security risks and responsibilities that came with. If I were to use a service like this myself, there is no way I would upload all my messages to some random persons server somewhere, so from the start I knew it had to work offline.

It was all written in vanilla JavaScript, only using Google Charts for the plotting.

Unfortunately Facebook has the habit of changing the format in which data is downloaded - so at time of writing (2021), the tool doesn't work as well as it once did. When it was written, each conversation was one JSON file. Now a single conversation can be split into multiple JSON files. It still works, it's just not as useful or interesting to only analyse a fraction of a longer conversation history.

I don't have any plans to update it at this stage, but it might be something I do in the future. Perhaps using some new skills I have learned (like React/Gatsby) to give it a bit more structure, rather than it just being one big main.js file.

© 2021