It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
high rated
This script colors and/or hides general discussion forum topics which contain keywords you specify yourself.

By default, it hides topics containing any of the following: giveaway, win, vote, gift. A small link in the upper right tells you how many threads are invisible, and allows you to show them again. Click 'prefs' to open a preferences box. Here, you can add or change filter terms (which can include the topic author's name), topic colors, and topic visibility.

It works with both forum color schemes.

I've tested extensively on Vista Firefox with greasemonkey, and briefly on Chrome with tampermonkey.

---

Firefox installation::
1. Install greasemonkey add-on.
2. Visit the site below and click the "install" button at the upper right.
(The site may contain ads with big download buttons. Ignore them. You want the "install" button.)

http://userscripts.org/scripts/show/173407

---

Chrome installation:
1. Install Tampermonkey for chrome.
2. Visit the site below and click the "install" button at the upper right.
(The site may contain ads with big download buttons. Ignore them. You want the "install" button.)

http://userscripts.org/scripts/show/173407

3. Chrome will prompt you with a question: Do you want to install the script through Tampermonkey, or natively within Chrome? Click OK to install through Tampermonkey.

---

Here's a link to my first forum script: (So you can see I've done this before.)
http://www.gog.com/forum/general/hide_giveaway_threads_greasemonkey/page1

You can view the script source on the userscripts site. I'm happy to answer any questions about how it works. If the script works (or doesn't work) for you, please let me know.

***IF YOU'RE USING MY OTHER SCRIPT, PLEASE DISABLE IT BEFORE INSTALLING THIS ONE.*** Running them both concurrently would probably make a fine mess.
Attachments:
Post edited July 15, 2013 by grimwerk
Cool! Thank you for the new and improved script! Great work!
avatar
Lifthrasil: Cool! Thank you for the new and improved script! Great work!
You're very welcome. Thanks for being the first to take the plunge!

Now I can get back to gnawing on forum puzzles.
Nicely done - may use this myself to hide certain threads! Cheers Grimmers!
Thanks for the update, man, very much appreciated.
like wow - brilliantly done grimwerk +1
Just a heads up.

Some members may need to change the following lines
// @include http://www.gog.com/forum/general/page*
// @include http://www.gog.com/forum/general#*
// @include http://www.gog.com/forum/general

to
// @include https://secure.gog.com/forum/general/page*
// @include https://secure.gog.com/forum/general#*
// @include https://secure.gog.com/forum/general

for the script to work.
avatar
Lifthrasil: Cool! Thank you for the new and improved script! Great work!
avatar
grimwerk: You're very welcome. Thanks for being the first to take the plunge!

Now I can get back to gnawing on forum puzzles.
Nice work :-)

I hate being the one to spot what I think is a bug.
The "STICKY: GOG.com Downloader (Windows & Mac client) discussion" topic follows the rule set for the keywords "giveaway, gift, win, vote".
You can verify this in your own screenshots.

EDIT: It's because of the word Windows in its title.
And it seems to also affect any thread that either has the keywords in its title or in the username (like the topic created by FreedomWings).
Post edited July 15, 2013 by HypersomniacLive
avatar
HypersomniacLive: helpful stuff
Thanks for both comments, Hypersomniac.

I reckon I should simply add those https includes to the script.

As for the matching, you're correct. It's a really basic match. Does the string:
35 min. ago Customizable forum topic filter (greasemonkey) 7 grimwerk
contain the string "win" or "giveaway" etc. So as you say, 'win' matches 'windows', 'winning', 'wins' 'owing', etc. Personally, I was fretting over the potential loss of Wing Commander threads, but I figured people could remove 'win' from their keywords easily enough. Still, I should have been clearer about how the matching is done.

Maybe I should make 'win' match [non-letter]win[non-letter] instead. People would have to add variations to their keywords lists, (example: "rpg", "rpgs"), but it'd cut down on the false-positives.
avatar
HypersomniacLive: helpful stuff
avatar
grimwerk: Thanks for both comments, Hypersomniac.

I reckon I should simply add those https includes to the script.

As for the matching, you're correct. It's a really basic match. Does the string:
35 min. ago Customizable forum topic filter (greasemonkey) 7 grimwerk
contain the string "win" or "giveaway" etc. So as you say, 'win' matches 'windows', 'winning', 'wins' 'owing', etc. Personally, I was fretting over the potential loss of Wing Commander threads, but I figured people could remove 'win' from their keywords easily enough. Still, I should have been clearer about how the matching is done.

Maybe I should make 'win' match [non-letter]win[non-letter] instead. People would have to add variations to their keywords lists, (example: "rpg", "rpgs"), but it'd cut down on the false-positives.
I appreciate what you're doing, glad if I could be of help.

Removing 'win' is what made me noticed the matching pattern.

Maybe you should wait for more feedback before going ahead with any changes?

Regarding the keyword matching, did I understand it correctly that there's a character limit per keyword rule?
avatar
HypersomniacLive: Regarding the keyword matching, did I understand it correctly that there's a character limit per keyword rule?
There's no explicit character limit per keyword. There is a 200 character limit per keyword field. (There are four keyword fields.) That is, one keyword set: (giveaway, win, vote, hammer, screwdriver, knuckleduster, etc.) cannot be 200+ characters.

The story behind the limit: Some days ago, I had intended to store user preferences in a cookie. As the script is running within a gog.com page, it would have been a gog.com cookie. I was concerned that writing a large (4kb) cookie would obliterate other gog cookies and log users out. So I imposed the above limit to keep the total cookie size under 1kb. I then wrote a letter to gog letting them know what I was doing. I didn't want their servers/admins to be confused by a sudden influx of unknown cookies. (Cookies are sent to the server with every http request.) As I finished the letter, it occurred to me that these cookies might add up, and looked around to see if I could create cookies that aren't sent to the server. As it turns out, there is this awesome browser object called localStorage and I needn't bother with cookies at all. The script stores your preferences there instead. I never sent the letter, as it turns out my script doesn't affect gog at all, which is the way I prefer it.

So I also have this unjustified concern that enormous keyword lists might affect performance, and so the 200 character limit is still there. Easy enough to increase, as localStorage is huge. I only use a handful of keywords myself. We'll see if other users start bumping into the limit.

Please excuse my rambling story.

I'm looking at improving the matching now.
avatar
HypersomniacLive: Regarding the keyword matching, did I understand it correctly that there's a character limit per keyword rule?
avatar
grimwerk: There's no explicit character limit per keyword. There is a 200 character limit per keyword field. (There are four keyword fields.) That is, one keyword set: (giveaway, win, vote, hammer, screwdriver, knuckleduster, etc.) cannot be 200+ characters.
snip
We're talking about the same thing - I call it keyword rule as, in practice, it feels to me like setting a rule.

avatar
grimwerk: snip
The story behind the limit: Some days ago, I had intended to store user preferences in a cookie. As the script is running within a gog.com page, it would have been a gog.com cookie. I was concerned that writing a large (4kb) cookie would obliterate other gog cookies and log users out. So I imposed the above limit to keep the total cookie size under 1kb. I then wrote a letter to gog letting them know what I was doing. I didn't want their servers/admins to be confused by a sudden influx of unknown cookies. (Cookies are sent to the server with every http request.) As I finished the letter, it occurred to me that these cookies might add up, and looked around to see if I could create cookies that aren't sent to the server. As it turns out, there is this awesome browser object called localStorage and I needn't bother with cookies at all. The script stores your preferences there instead. I never sent the letter, as it turns out my script doesn't affect gog at all, which is the way I prefer it.

So I also have this unjustified concern that enormous keyword lists might affect performance, and so the 200 character limit is still there. Easy enough to increase, as localStorage is huge. I only use a handful of keywords myself. We'll see if other users start bumping into the limit.

Please excuse my rambling story.

I'm looking at improving the matching now.
Not a rambling story at all, I find this 'behind the scene" stuff interesting.

Personally, I'd be more interested in more keyword fields - don't know how much work that is but it'd allow more flexibility in setting keyword rules :-)
avatar
HypersomniacLive: Personally, I'd be more interested in more keyword fields - don't know how much work that is but it'd allow more flexibility in setting keyword rules :-)
You may have noticed that the first keyword field has precedence over the second. That is, if a topic matches the first rule, it won't even be compared against the second, third, and fourth. You could use this to protect topics containing the word 'windows' but still hide those that contain 'win'.

See attached. The sticky matches 'windows' from the first rule and remains visible. It is never matched against the second rule. Maybe not the prettiest way of doing things!

How many keyword fields would you like? Also, I considered allowing regular expressions in the keyword fields, but I figured that was just giving users (and myself) rope with which to hang themselves.
Attachments:
avatar
grimwerk: You may have noticed that the first keyword field has precedence over the second. That is, if a topic matches the first rule, it won't even be compared against the second, third, and fourth. You could use this to protect topics containing the word 'windows' but still hide those that contain 'win'.

See attached. The sticky matches 'windows' from the first rule and remains visible. It is never matched against the second rule. Maybe not the prettiest way of doing things!
Yes, I noticed this behavior and I'm trying to decide the best order for my rules.

avatar
grimwerk: How many keyword fields would you like?
How many? Haven't really thought this through yet.
I look at your script as a tool to visually "manage" the forum topics and not just as a filter to hide threads based on keywords, so four keyword fields feels a bit restrictive.
Would it be too much to suggest 8-10?

avatar
grimwerk: Also, I considered allowing regular expressions in the keyword fields, but I figured that was just giving users (and myself) rope with which to hang themselves.
LOL
Oh, that looks very interesting, will give it a try. Big thanks for your effort.