Skip to content

Instantly share code, notes, and snippets.

@Ivajkin
Last active June 16, 2022 06:08
Show Gist options
  • Select an option

  • Save Ivajkin/b1a1da24dfbe4f5132e1bdc1fde09fb1 to your computer and use it in GitHub Desktop.

Select an option

Save Ivajkin/b1a1da24dfbe4f5132e1bdc1fde09fb1 to your computer and use it in GitHub Desktop.
Can be used with Run Javascript – Chrome Extension. Hides and make opaque low rating sites on Google according to SiteJabber rating.
setTimeout(() => {
var ratings = document.querySelectorAll(".sj_info"); var blocks = document.querySelectorAll("[sj_processed='true']");
for (let index = 0; index < ratings.length; index++) {
var rating = ratings[index];
var block = blocks[index];
var number = Number(rating.textContent.split(" ")[0]);
var opacity = Math.max(Math.min((Math.pow(number,1.2)-0.05)/5 + 0.05, 1), 0);
rating.style.opacity = block.style.opacity = opacity;
if(opacity < 0.1) {
rating.style.display = block.style.display = 'none';
}
console.log({number});
console.log({opacity});
}
}, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment