This is part 2 of a series. If you are reading this and it feels whoa out of context I will kindly direct you back to part 1 click here:
After the long, hard journey of scrolling through a never ending feed of network requests, painstakingly extracting all the juicy, mouthwatering data and generating my totally *slay* graph, I did what every normal person would do- post it on Instagram, where my epic journey all started.
I know, its a very circular narrative structure, for the English nerds out there ;)
And when I posted it and it reached its terminal like count (by guessing, around 30), my friends told me that they liked my post when I talked to them the next day. That was a great ego boost but I was wondering => did they really like it? And as you can see from the graph, I have 10 posts. Every time I post, the next day, people would say "omg that was so good i totally fr fr liked all ur posts" or something like that (memories can be faulty). But did they really though? As you can see from the crystal clear data, my likes were fluctuating, just like a normal teenage mood swing.
The point was, I had a new idea, one that I could expand on, which is why you are seeing a part 2 of this mini series. And if I have another crazy idea, you would see a part 3. But that's for next time, sometime in the near or far future.
What if I could get the number of times each person in my friends/followers list had liked my posts? I could do this manually of course, if I were to click on more details of each post, and scrolled down, I would see who exactly liked my post. Let the Liking Games begin, where the winner has pressed that juicy like button the most.
What a good way to incite friendly competition amongst friends. Instead of a potentially heated argument or a fierce running race where I would certainly be out of breath after a few futile minutes, I could simply flash the undeniable, concrete data to prove who was the real winner.
In order to find out which people *specifically* liked my posts, I had to follow the holy grail of data collecting, again. Scrolling through network requests to find out the source of the giant stream of data which powers everything.
I'm going to decrease the level of yap for the moment, so you can enjoy this giant list of pictures showing the process of gathering data ---for the second time if you have already viewed the first article---
The old saying -- "A picture is a thousand words" is very much relevant here, so I hope you enjoyed reading the 3x1000 word academic essay. (cue round of applause).
Anyway
Now I have all the data, I can finally arrange them into a desired format, to, ya know, easier convey the big flex across.
Same old process of using postman to test requests 😃
Then repeating the same process in python. Well somewhat similar. The feature of getting how many times a friend liked my total posts is not exactly provided in the obvious way unlike just getting likes and comments. I could just go onto a post and check the like number but in order to find who liked it, and calculating (adding it up) for all posts, is a whole different story.
It chucks a request at a nicely named url endpoint 'likers', conveniently indicating what I was looking for- who liked my posts
By using the request to get likes and comments counts (from the previous article) I could get the 'pk' of each of the posts; although I like to think it means 'pookie' used in 'pookie bear' it more likely means 'primary key', used to identify record in databases. BORING but necessary.
When looking at the data, you can see everyone that liked the post, and their usernames.
Going through the /likers endpoint for different posts (by using the ‘pk’) there are some similarities of who appears in the list. This means that one person liked multiple posts. 5. Thus going through the all the /likers endpoint for each of the, and gathering data from the response of each endpoint and storing it in a dictionary format (key:value structure) was a good option. 6. And thus, the graphing.
Adding necessary axis labels, letting the computer know what data to put where etc... (necessary admin stuff).
Zoom in if you don't want to spend the day looking at the numbers 😅
Well all these steps were used on my account but if I wanted to, I could also use it on other people's accounts and grab some visualised data, not offered natively in Instagram.
I don’t have a clue but like →
It looks cool 😎 (undeniably)
Its a weird flex 💪 -- while everyone else is showing cool pics of their dog on instagram, their rave times on parties or tropical cool beaches I’m just standing awkwardly like ==> "umm I don’t exactly go anywhere 'fun' cuz im a couchworm but here check out this messy, barely legible graph I made of your instagram data 📊 🤷🤷🤷"
Also it can start a friendly rivalry -- heres a short roleplay
Me: Hey person a, check out this graph on how much times others liked your posts
Person A: Thanks bro, interesting (looks intently at the graph, making sure to squint eyes due to the tiny font size) ...... OMG PERSON B ONLY LIKED MY POSTS 8 OUT OF 10 TIMES!!!!!@#!@$#$# I THOUGHT THEY WERE MY BEST FRIEND!@#!@$@##!@$#%% (cue intense crying noises)
Person B: Omg bro are you ok?
Person A: OMG YOU SAID YOU LIKED ALL MY INSTAGRAM POSTS BUT YOU DIDN’T YOU GODDAMN LIAR!!!
Person C: (silently appearing from nowhere ) hey would you look at that, I liked your posts 10 times :)
Person A: Thanks buddy, you’re my new best friend now, just ignore the fact that I knew person b for like 10 years while I only know u for like 10 days or something