JeTmAn81
Member
Ever get tired of all those uninteresting threads clogging up your GAF screen (Destiny, I'm thinking of you)? I certainly do, and I always wished there was a way to get rid of the threads I don't care about and only see the ones that are new or interest me. So I wrote a script to do it.
To hide a thread, hover near the GAF symbol on the left of the thread and you'll get an X. Click that X and it will disappear. You'll never see it again unless you select Show Ignored Only or Show All from the select list next to the Post New Thread button at the top of the page. You will also get an X when viewing the ignored list. Thanks to lednerg for the CSS to do this. Clicking that will redeem it from its shadowy banishment and return it to the list of normally viewable threads.
I've updated the thread filtering process to search up to 5 additional pages for threads. If it can't find 40 unignored threads on the page you're on, it will look at the next page, and the next, etc. to find threads which you haven't ignored either explicitly or through word or user filtering, and will load them in at the bottom of the page. This should allow you to keep a full page of threads you're interested in.
There is a filter CP (control panel) button next to the filter select list. Clicking that will open up three tabs:
Word Filter- This will let you filter thread titles by word. You can use * to indicate wild cards in plain text entries, or you can enter a full regular expression. You can also choose to apply word filtering to only gaming or only off-topic if you wish.
Ignored List - This will show you the threads you've ignored, starting with the most recent. The titles are links to the threads. You can click a button to redeem any of them. The main thread list will refresh when you close the filter control panel.
Settings - You can choose if you want the hide link option to show up as an X that appears when you hover over a thread/user, or if you want a specific hide/show link to show up next to each thread at all times.
You can also turn on or off the option to search additional pages for non-filtered threads. It's recommended to turn this on as it will help keep a whole displayed page full of interesting threads.
You can also choose the option to have threads expire from filtering after a certain amount of time. That means that threads which are explicitly ignored can come off the ignore list automatically. If you don't want threads to ever come back (unless you un-ignore them), don't select this option.
Lastly, you can enable cloud syncing. Click the generate button to create a new cloud sync key. Enter that same key in other browsers/computers to keep your data
synced up. You have the option to sync data instantly (every time a change is made), or every 1/5/10 minute(s).
Note that cloud sync frequency is set individually per instance, and is not saved to the cloud, so you'll have to set it
to what you want. Default is 5 minutes.
Down sides:
1. No mobile version
2. It makes the page load a little slower.
And finally here's the script. I am lousy with Javascript so feel free to make modifications or point out inefficiencies. Let me know if it seem useful to you! I've been dreaming about having the ability to do this for a long time so it's quite satisfying to finally be able to zap away all those pesky threads I'll never be interested in. I've now hosted the script on GreasyFork:
https://greasyfork.org/en/scripts/7106-hide-forum-threads
If you already have a user script plugin for your browser, you can just hit the install button. If not, hit the question mark next to the install button and it should link you to user script plugin/extensions for various browser types. After you've installed one of those, then you can go back and hit the install button.
edit: The code has been updated to version 0.2. The code has been cleaned up and a word filtering option has been added. The word filter button appears next to the filter list and allows you to filter by plain text (with optional * wildcard) or regular expression. The thread listing is updated as soon as you close the word filter box.
edit 2: Version 0.3 released. Adds filter control panel offering settings and list of ignored threads. Searches additional pages for unignored threads in an effort to display 40 threads on a page. Hide thread link display type updated.
edit 3: Version 0.4 released. Bug in Firefox causing thread filter selection to go blank fixed. Updated UI to display X's next to the GAF logo for each thread in Chrome, Firefox and Opera. Clicking the X ignores the thread. Ignore user ability added, an X will now appear next to the starter of a thread. Clicking the X will ignore all threads posted by that user. Does not extend into thread view itself, so you would still see posts by that user if you didn't ignore them through GAF itself.
edit 4: Update - v5.0 Released
Cloud sync - Cloud syncing has been enabled. By default it is turned off. You may enable it on the settings tab of the control panel.
Link styling - You now have the option to have the hide thread/user links show up the normal way (an X appears when
you hover over the NeoGAF logo for threads or the user's name for users) or to have Hide/Show specific links show up.
Defaults to "X". This can be changed on the settings tab.
Word filter area - You now have the option to apply a word filter only to gaming or off-topic sections. By default, word filtering
will apply to all areas, but you can make it specific when you add a new word now.
Bug fix(es) - Fixed the issue where the control panel was enlarging every time it was opened. Should now default to
60% of screen size.
edit 5: Update - v6.0
Minor bugfixes to get rid of the issue with repeated thread listings and also an issue preventing any more additional threads from being retrieved after 5 threads had been hidden in one session.
The last thing to do would be a mobile version. I've got a basic version working, but it's somewhat slow and buggy so it may not work out until there are better tools for running user scripts on Android/iOS. Have currently tested with TamperMonkey for Android and Dolphin on Android.
edit 6: Update - v7.0
Added the thread expiration setting. You can set threads to be automatically removed from the filter after a certain amount of days. This only applies to threads which have been explicitly ignored (as opposed to ignored via word or user filtering).
The main thread filtering process has been updated to use binary search rather than linear search. This reduces much of the processing time from linear to logarithmic. Now let's learn a little about time complexity!
If you've hidden 1,000 threads, a linear process would potentially have to search all 1,000 records for each thread which might be displayed in order to check and make sure the thread that GAF wants to show you isn't in the ignore list. By contrast, a logarithmic process can do that same search by checking only 10 records. That's about 10,000% more efficient! What's more, if your hidden thread list doubled to 2,000, the linear method could still need as many as 2,000 checks to make sure a thread should be shown, whereas the logarithmic method would only need to check one more record (for a total of 11 checks).
Ok, end learning time. The bottom line is that very large ignored thread lists should now get processed a lot more quickly.
As always, let me know if you spot any bugs as I've made quite a few changes.
To hide a thread, hover near the GAF symbol on the left of the thread and you'll get an X. Click that X and it will disappear. You'll never see it again unless you select Show Ignored Only or Show All from the select list next to the Post New Thread button at the top of the page. You will also get an X when viewing the ignored list. Thanks to lednerg for the CSS to do this. Clicking that will redeem it from its shadowy banishment and return it to the list of normally viewable threads.
I've updated the thread filtering process to search up to 5 additional pages for threads. If it can't find 40 unignored threads on the page you're on, it will look at the next page, and the next, etc. to find threads which you haven't ignored either explicitly or through word or user filtering, and will load them in at the bottom of the page. This should allow you to keep a full page of threads you're interested in.
There is a filter CP (control panel) button next to the filter select list. Clicking that will open up three tabs:
Word Filter- This will let you filter thread titles by word. You can use * to indicate wild cards in plain text entries, or you can enter a full regular expression. You can also choose to apply word filtering to only gaming or only off-topic if you wish.
Ignored List - This will show you the threads you've ignored, starting with the most recent. The titles are links to the threads. You can click a button to redeem any of them. The main thread list will refresh when you close the filter control panel.
Settings - You can choose if you want the hide link option to show up as an X that appears when you hover over a thread/user, or if you want a specific hide/show link to show up next to each thread at all times.
You can also turn on or off the option to search additional pages for non-filtered threads. It's recommended to turn this on as it will help keep a whole displayed page full of interesting threads.
You can also choose the option to have threads expire from filtering after a certain amount of time. That means that threads which are explicitly ignored can come off the ignore list automatically. If you don't want threads to ever come back (unless you un-ignore them), don't select this option.
Lastly, you can enable cloud syncing. Click the generate button to create a new cloud sync key. Enter that same key in other browsers/computers to keep your data
synced up. You have the option to sync data instantly (every time a change is made), or every 1/5/10 minute(s).
Note that cloud sync frequency is set individually per instance, and is not saved to the cloud, so you'll have to set it
to what you want. Default is 5 minutes.
Down sides:
1. No mobile version
2. It makes the page load a little slower.
And finally here's the script. I am lousy with Javascript so feel free to make modifications or point out inefficiencies. Let me know if it seem useful to you! I've been dreaming about having the ability to do this for a long time so it's quite satisfying to finally be able to zap away all those pesky threads I'll never be interested in. I've now hosted the script on GreasyFork:
https://greasyfork.org/en/scripts/7106-hide-forum-threads
If you already have a user script plugin for your browser, you can just hit the install button. If not, hit the question mark next to the install button and it should link you to user script plugin/extensions for various browser types. After you've installed one of those, then you can go back and hit the install button.
edit: The code has been updated to version 0.2. The code has been cleaned up and a word filtering option has been added. The word filter button appears next to the filter list and allows you to filter by plain text (with optional * wildcard) or regular expression. The thread listing is updated as soon as you close the word filter box.
edit 2: Version 0.3 released. Adds filter control panel offering settings and list of ignored threads. Searches additional pages for unignored threads in an effort to display 40 threads on a page. Hide thread link display type updated.
edit 3: Version 0.4 released. Bug in Firefox causing thread filter selection to go blank fixed. Updated UI to display X's next to the GAF logo for each thread in Chrome, Firefox and Opera. Clicking the X ignores the thread. Ignore user ability added, an X will now appear next to the starter of a thread. Clicking the X will ignore all threads posted by that user. Does not extend into thread view itself, so you would still see posts by that user if you didn't ignore them through GAF itself.
edit 4: Update - v5.0 Released
Cloud sync - Cloud syncing has been enabled. By default it is turned off. You may enable it on the settings tab of the control panel.
Link styling - You now have the option to have the hide thread/user links show up the normal way (an X appears when
you hover over the NeoGAF logo for threads or the user's name for users) or to have Hide/Show specific links show up.
Defaults to "X". This can be changed on the settings tab.
Word filter area - You now have the option to apply a word filter only to gaming or off-topic sections. By default, word filtering
will apply to all areas, but you can make it specific when you add a new word now.
Bug fix(es) - Fixed the issue where the control panel was enlarging every time it was opened. Should now default to
60% of screen size.
edit 5: Update - v6.0
Minor bugfixes to get rid of the issue with repeated thread listings and also an issue preventing any more additional threads from being retrieved after 5 threads had been hidden in one session.
The last thing to do would be a mobile version. I've got a basic version working, but it's somewhat slow and buggy so it may not work out until there are better tools for running user scripts on Android/iOS. Have currently tested with TamperMonkey for Android and Dolphin on Android.
edit 6: Update - v7.0
Added the thread expiration setting. You can set threads to be automatically removed from the filter after a certain amount of days. This only applies to threads which have been explicitly ignored (as opposed to ignored via word or user filtering).
The main thread filtering process has been updated to use binary search rather than linear search. This reduces much of the processing time from linear to logarithmic. Now let's learn a little about time complexity!
If you've hidden 1,000 threads, a linear process would potentially have to search all 1,000 records for each thread which might be displayed in order to check and make sure the thread that GAF wants to show you isn't in the ignore list. By contrast, a logarithmic process can do that same search by checking only 10 records. That's about 10,000% more efficient! What's more, if your hidden thread list doubled to 2,000, the linear method could still need as many as 2,000 checks to make sure a thread should be shown, whereas the logarithmic method would only need to check one more record (for a total of 11 checks).
Ok, end learning time. The bottom line is that very large ignored thread lists should now get processed a lot more quickly.
As always, let me know if you spot any bugs as I've made quite a few changes.