messenger analysis

My third project was about counting the messages sent via the app Messenger (Facebook). It is not as complicated as the previous scripts I wrote. The whole file is no longer than thirty lines. I was curious to know how many messages I have sent to certain people or who sent the most messages in a given group. The users have to first download their Facebook data, most importantly the JSON files, which contain all of the messages. Now all they have to is to load them into the program. They get to know how many messages they've sent to each other with a friend. There is definitely more to explore in the data, but I didn't feel the desire to continue and finish it.

Go Up
Results Illustration

how it works

  1. The JSON files are loaded one by one and put together
  2. Python dictionary is created, where the results will be stored
  3. Using the "for" loop, every message is looked at
  4. It looks for the "sender_name" tag and takes its value
  5. If it is the first message of the person, a new key is created in the dictionary
  6. Otherwise, it adds +1 message to the person's value
  7. For every loop, +1 is added to the total number of messages
  8. The final numbers are shown in the command line

Contact

Leave a message:

Prague, Czech Republic

Copyright © 2021 Adam Tran