Skip to content

Instantly share code, notes, and snippets.

@user19
Created October 14, 2014 14:12
Show Gist options
  • Save user19/a514b4087886f56ea717 to your computer and use it in GitHub Desktop.
Save user19/a514b4087886f56ea717 to your computer and use it in GitHub Desktop.
javascript:(function(){var buttonElements=document.getElementById('watch-like-dislike-buttons').getElementsByClassName('yt-uix-button-content');var viewElement=document.getElementById('watch7-views-info');var i=another=Number(buttonElements[0].innerHTML.replace(",",""));var j=Number(buttonElements[1].innerHTML.replace(",",""));var count=setInterval(function(){counter(i);i++;if(i>=another+1000){clearInterval(count);}},10);function counter(num){buttonElements[0].innerHTML=String(num).replace(/(\d)(?=(\d\d\d)+(?!\d))/g,'$1,');viewElement.getElementsByClassName('video-extras-sparkbar-likes')[0].style.width=100*num/(num+j)+'%';viewElement.getElementsByClassName('video-extras-sparkbar-dislikes')[0].style.width=100*j/(num+j)+'%';}})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment