This Post has 100 Positive Reactions

Sahil Bondre - Apr 8 '20 - - Dev Community

The script mentioned in the following blog post has been turned off now. So the script doesn't know when someone gave a positive reaction. But, I do and it delights me when I get a positive reaction 😄

Recently Tom Scott posted a video on Youtube whose title has the number of views of the video.

Alt Text

Here is what's happening behind the scenes. There's a script running which continuously updates the title of the video to match the view count. In the video, he talks about the rise (and kind of fall) of APIs provided by platforms. He talks about creative applications of accessing APIs and making bots.

I was quite amused by the video. Luckily Dev.to has its API in beta stage. Lightbulb! So I wrote a small Typescript Bot that continually updates the total positive reactions to this post in the title. If everything is working alright, the sum of the positive responses to the post should match with the title. If it is not, then I either shut down the script, or it crashed.

Alt Text

The fun part is that you can try the code yourself and publish your post like this one! Find the code in this repo

🚀 Find me on Instagram | Github | Twitter | Website
😄 Have a wonderful day!

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player