Greasy Fork is available in English.

Vlamtweet

Replaces the Twitter "like" button with a tiny Vlambeer logo, effects included.

< Feedback on Vlamtweet

Review: OK - script works, but has bugs

§
Posted: 2015-11-04

Slight modification

Script wasn't working for me so I changed the target conditions. Also added a more dramatic shake for tweets with lots of faves. Changed portion below:



document.body.addEventListener("click", function(e) {
if (!e.target.classList.contains("ProfileTweet-actionButton") || !e.target.classList.contains("js-actionFavorite")) return;
var shake = Math.max(8, 2*Math.floor(Math.log2(parseInt(e.target.getElementsByClassName("IconTextContainer")[0].getElementsByClassName("ProfileTweet-actionCount")[0].getAttribute("data-tweet-stat-count")))));
var shakeScale = shake/2;

§
Posted: 2015-11-04

After a little more investigation data-tweet-stat-count isn't actually populated on your first click. after you favorite and unfavorite it'll be populated when you favorite again (which I didn't realize while testing initially). Changed to:

var shake = Math.max(8, 2*Math.floor(Math.log2(parseInt(e.target.getElementsByClassName("IconTextContainer")[0].getElementsByClassName("ProfileTweet-actionCount")[0].getElementsByClassName("ProfileTweet-actionCountForPresentation")[0].textContent))));

Post reply

Sign in to post a reply.