Script to Hide Poorly Rated Webteases

All about the past, current and future webteases and the art of webteasing in general.
---
Post Reply
g[mx]
Explorer
Explorer
Posts: 30
Joined: Mon Dec 01, 2008 10:06 pm

Script to Hide Poorly Rated Webteases

Post by g[mx] »

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.
User avatar
SexualChoc
Chat Moderator
Posts: 3144
Joined: Mon Aug 10, 2009 1:22 pm
Gender: Male
Sexual Orientation: Straight
I am a: Switch
Location: Missouri, Usa
Contact:

Re: Script to Hide Poorly Rated Webteases

Post by SexualChoc »

Now THAT is a good idea!

Thank you very much!
all2true
is my other profile. see my chastity belt link :
http://www.milovana.com/forum/viewtopic ... 16#p139016
User avatar
Azureballs
Explorer At Heart
Explorer At Heart
Posts: 119
Joined: Sat Oct 28, 2006 5:30 pm
Gender: Transsexual/Transgender
Sexual Orientation: Open to new ideas!
I am a: Submissive
Location: USA

Re: Script to Hide Poorly Rated Webteases

Post by Azureballs »

Thank you!
real-webjunky
Explorer
Explorer
Posts: 60
Joined: Sat Jun 23, 2007 11:09 pm

Re: Script to Hide Poorly Rated Webteases

Post by real-webjunky »

sounds very good ;) have to check for this.

what about new teases in the minutes they have no rating at all?
User avatar
les
Experimentor
Experimentor
Posts: 6126
Joined: Thu Apr 19, 2007 10:04 am
Gender: Male
Sexual Orientation: Bisexual/Bi-Curious
I am a: Dom (Male)
Sub/Slave(s): My serfs
All 2 True is head Serf
Location: London England
Contact:

Re: Script to Hide Poorly Rated Webteases

Post by les »


I for one wish independent verification'
That this is safe from some of our other programmers,
Before I implement it.
                                          Lord Les
                                 Be careful what you wish for!

Growing OLD Is Inevitable,
          But Growing UP... Is Optional
                    OR
                              Why do I have to stop being a KID now I can afford it.







                                
                                                                                                                                                   
curved
Explorer At Heart
Explorer At Heart
Posts: 110
Joined: Sat Mar 31, 2007 11:09 pm

Re: Script to Hide Poorly Rated Webteases

Post by curved »

I like it - works fine in Chrome. I know enough about javascript to know it isn't doing anything harmful but won't go as far as giving official verification...
Nooble
Explorer
Explorer
Posts: 16
Joined: Sat Feb 21, 2009 6:33 pm

Re: Script to Hide Poorly Rated Webteases

Post by Nooble »

@les
I know a little Javascript, it doesn't look as though it's doing anything harmful. As 'curved' said, I also cannot provide official verification, but personally I wouldn't hesitate to use it.

My only issue would be on a moral level really. I'm not sure I trust users voting sensibilities or the voting system enough to warrant filtering out all poorly rated teases, although I too am annoyed by the prevalence of self-advertising teases lately.
g[mx]
Explorer
Explorer
Posts: 30
Joined: Mon Dec 01, 2008 10:06 pm

Re: Script to Hide Poorly Rated Webteases

Post by g[mx] »

real-webjunky wrote:what about new teases in the minutes they have no rating at all?
Didn't test that. My guess is it will be hidden with a rating of "0.0" - you'll have to click on the replacement text to display it.

The security concerns are absolutely valid, although the script doesn't anything bad, can't give you more than my word about that.

However the code shouldn't be that hard to understand by a decent javascript programmer: The script essentially asks the browser to be executed every time the tease list is changing (e.g. paging), it then processes all teases and hides those with a rating less than 2.5.

If you want to be more secure, take a look at the source when clicking on the installation link (or copy and install the code manually).
User avatar
cumhardy
Experimentor
Experimentor
Posts: 1145
Joined: Wed May 28, 2008 10:54 pm
Gender: Male
I am a: None of the above
Location: UK

Re: Script to Hide Poorly Rated Webteases

Post by cumhardy »

thanks for this! How do I use it in chrome?
User avatar
janmb
Experimentor
Experimentor
Posts: 1658
Joined: Sun Aug 16, 2009 3:25 pm
Gender: Male
Sexual Orientation: Straight
I am a: Submissive

Re: Script to Hide Poorly Rated Webteases

Post by janmb »

les wrote:
I for one wish independent verification'
That this is safe from some of our other programmers,
Before I implement it.
Don't worry, it is clean

That's another nice thing about scripted languages - so much easier to see what it does and doesn't do.


Thanks for the script - I love it. One possible amendment to consider though, if at all possible, would be to always display favourite teases regardless of rank.
Yes, I most certainly CAN do it again!
Post Reply