Hey there Milovana,
Being annoyed by poor or self-advertising teases, I've decided to write a little script which hides all poorly rated teases (less than 2.5 stars) in the webteases browser.
If anyone else wants to use it, it's designed for Firefox 4 or 5 with the
Greasemonkey Add-On (you need to install this first) or any recent version of Google Chrome.
To install the script just click on this link:
http://gmx.bplaced.net/badtease.user.js
Or save the following code as textfile named "badtease.user.js" and drag it over your browser:
- Spoiler: show
Code: Select all
// ==UserScript==// @name Hide Bad Teases// @namespace milovana// @description Hides poorly rated webteases on Milovana// @include http://www.milovana.com/webteases/*// @match http://www.milovana.com/webteases/*// ==/UserScript== var MIN_RATING = 2.5; function init() { document. getElementById("tease_list"). addEventListener('DOMNodeInserted', hideTeases, false); hideTeases()} function hideTeases() { var teases = document.getElementsByClassName("tease"); for(var i=0; i < teases.length; i++) { var rating = teases[i].getElementsByClassName("rating_text")[0].firstChild.data; if(rating < MIN_RATING && !teases[i].tagged) { teases[i].tagged = true; var replacement = document.createElement("div"); var toggleLink = document.createElement("span") var text = document.createTextNode("Hidden Tease (Rating: "+rating+")"); toggleLink.addEventListener('click', (function(tease) { return function () { tease.style.display = (tease.style.display == "none") ? "block" : "none"; } })(teases[i]), false); replacement.appendChild(toggleLink); replacement.className = "tease_toggle"; teases[i].style.border = "1px dashed #933737"; teases[i].style.padding = "4px"; toggleLink.appendChild(text); toggleLink.className = "fakelink smallprint"; teases[i].parentNode.insertBefore(replacement, teases[i]); teases[i].style.display = "none"; } }} if(document.body) { init();} else { document.addEventListener("DOMContentLoaded", init, false);}
It's a "works for me" solution, but maybe it's useful for someone else. If you want to change the rating threshold, just change the value of the "MIN_RATING" value on line 9.