3 ms·
I wrote a greasemonkey userscript for Firefox to reduce the number of non-technical articles. It works alright, I never meant it to be perfect, just get rid of
by erik66132 11y ago
I wrote a greasemonkey userscript for Firefox to reduce the number of non-technical articles. It works alright, I never meant it to be perfect, just get rid of the stuff that never is fun for me to read or is about topics that come up too often.
https://github.com/ErikHarmon/hncleanse/blob/master/hncleanse.user.js https://github.com/ErikHarmon/hncleanse/blob/master/hncleans...
- PopeOfNope 11y agoI did something very similar with dotjs before I realized it was introducing a 1-5 second delay in the loading of every webpage. How's the performance of this script?
- erik66132 11y agoIt's imperceptible to me. The number of search terms is pretty low. My regex isn't as sophisticated as it could be because the script started as a simple terms list using indexof, so it could be improved a little bit as more terms are added. Mainly I filter by entire sites, which helps a lot. I won't miss many technical articles by filtering nytimes, and if I do, I can live with that. I'll take PRs or suggestions, this was a ten minute project to scratch an itch.
- mcnamaratw 11y agoThanks for the link! I'll take a look!
- cyphunk 11y agoYour honesty made me giggle (and I do not mean that in a derogatory manner)... 'npr.org', // depressing 'nytimes.com', // will probably annoy me This patch also makes for an amusing HN experience and might answers the inverse "Ask HN: Is there a way to see only non-technical posts?" --- a/hncleanse.user.js +++ b/hncleanse.user.js @@ -148,7 +148,7 @@ while ((elem = result.snapshotItem(i)) != null) { if (shouldRemove || crap != null) { var reason = shouldRemove?('site '+sitebit):('terms '+crap); console.log(reason+': '+title); - + } else { var subtext = athing.nextSibling; subtext.parentNode.removeChild(subtext);