paint-brush
Graphing How Many Times People Liked my Posts on Instagramby@cookiemonster0921

Graphing How Many Times People Liked my Posts on Instagram

by vincentDecember 5th, 2024
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Visualising knowledge in a (somewhat) readable way, so you can flex on your friends and show your data collection skills.
featured image - Graphing How Many Times People Liked my Posts on Instagram
vincent HackerNoon profile picture

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 ;)


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 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.


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 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.

very frustrating process


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 big flex across.

Step 10: Roleplaying as instagram (again -_-)

Same old process of using postman to test requests 😃

again ;)


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.


  1. It chucks a request at a nicely named url endpoint 'likers', conveniently indicating what I was looking for- who liked my posts

  2. 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.


  3. When looking at the data, you can see everyone that liked the post, and their usernames.

  4. 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.

Step 11: Making another graphing monstrosity that math teachers would hate with a burning passion

Adding necessary axis labels, letting the computer know what data to put where etc... (necessary admin stuff).

And now the monstrosity

so messy

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 you seriously have to graph every single piece of data there is?

I don’t have a clue but like →

  1. It looks cool 😎 (undeniably)

  2. 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 📊 🤷🤷🤷"

  3. 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

    And here, new rivalries are born, wars are started and injustices are created

    hehehehehe

"knowledge is power"

But as you can see, what is more powerful is:

Visualising knowledge in a (somewhat) readable way, so you can flex on your friends and show your data collection skills.