pgamerx / yt-dislikes-viewer

A browser extension that allows you to see dislikes on a youtube video after the youtube update
https://yt-dislikes-viewer.js.org
GNU General Public License v3.0
296 stars 20 forks source link

Adding an `addBar()` function #18

Closed Adib-C closed 2 years ago

Adib-C commented 2 years ago

i added the addBar() function to show the likes percentage bar -> https://i.imgur.com/nGoT4Vk.png

but currently, it doesn't show the actual percentage of the likes and dislikes because i don't know how to get the likes percentage.

so you need to get the likes percentage and then run the function with the likes percentage as a parameter, example = addBar(78) that code will add a bar with 78% likes and 22% dislikes

pgamerx commented 2 years ago

Problem is, we don't know if a video is 90% liked and 10% disliked simultaneously

Adib-C commented 2 years ago

get the likes and dislikes from the actual content that is displayed, https://i.imgur.com/eVXNa7K.png , and then calculate how much percentage is the like

pgamerx commented 2 years ago

But if like is 90%, it doesn't necessarily mean that the dislike will be 10%

Adib-C commented 2 years ago

wdym?

pgamerx commented 2 years ago

10000 people watch the video, 9000 liked, this doesn't mean that the rest disliked.

Adib-C commented 2 years ago

lets say for example, there is 1k likes and 500 dislikes, we add them together, and then calculate how much percentage is the likes and how much percentage is the dislikes

pgamerx commented 2 years ago

lets say for example, there is 1k likes and 500 dislikes, we add them together, and then calculate how much percentage is the likes and how much percentage is the dislikes

I will have to get likes of the video using Youtube API causing increase in loading time of extension.

Adib-C commented 2 years ago

You don't have to, just use the data that is actually displayed on the page Screenshot_2021-11-20-21-47-11-79_f9ee0578fe1cc94de7482bd41accb329.jpg