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 ;)
The graph that made it all worthwhile :)
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 irl. That was a great ego boost but like -> 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 moodswing.
step 8: but wait......................................................................................................... there's more
If my likes are not consistent, but people say that my posts were good, does this mean that it must be the same people saying that it was good? (I cant remember manually if it were the same people. I post posts with some time apart and it is hard to remember who said what lol). But that's not the point.
The new idea
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.
step 9: MORE NETWORK REQUESTS
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).
yap machine is rebooting => beep => beep => beep
anyway
Now I have all the data, I can finally arrange them into a desired format, to, ya know, easier convey the biiig flex across.
step 10: roleplaying as instagram (again -_-)
same old, same old process of using postman to test requests
then repeating the same process in python. Well somewhat similar. As the feature of getting how many times friends liked posts is not exactly provided in the obvious way unlike just getting likes and comments from instagram. 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.
This code right here does a few things
- it chucks a request at a nicely named url endpoint 'likers', conveniently indicating what i was looking for- people that liked
- the code above gathers extremely necessary data related to be able to get the necessary data, gets 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 neccessary.
- when looking at it you can see everyone that liked the post, and their usernames
- Going through much of the /likers endpoint for different posts there are some similarities of who appears in the data. This means that one person liked multiple posts.
- 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.
- And thus, the graphing.
step 11: making another graphing monstrosity that math teachers would hate with a burning passion
adding neccessary axis labels, letting the computer know what data to put where etc... (neccessary admin stuff)and now the monstrosity
zoom in if you don't want to spend the day looking at the numbers
step 12: possible use cases/consequences?
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.
but why, do u seriously have to graph every single piece of data there is
idk 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 im just standing awkwardly like == "umm i dont 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 like 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 r u ok?
person a: OMG U SAID U LIKED ALL MY INSTAGRAM POSTS BUT YOU DIDNT YOU GODDAMN LIAR!!!
person c: (silently appearing from nowhere ) heyyy would you look at that, i liked your posts 10 times :)
person a: thanks buddy, ur 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
and here, new rivalries are born, wars are started and injustices are created
hehehehehe