Re:Show HN: Chrome Extension to Filter HN Stories by Keyword
by alistproducer2 on Monday January 23, 2017 @07:14PM
(#13467628)
Dev Here:
I made this because I'm tired of seeing political flame-stories on here and I hate flagging them or, even worse, going in the threads to complain about them.
With this extension you can make a comma-separated list of words that when matched within a headline, the link is removed from the page before you ever see it.
You can check the console to see what stories are being removed. It's open source so feel free to fork, customize, contribute or whatever.
It can be used to filter anything, so if you can't stand to see another "JavaScript" or "Python" story, you can block those too.
Re:Show HN: Chrome Extension to Filter HN Stories by Keyword
by alistproducer2 on Tuesday January 24, 2017 @10:01AM
(#13471790)
if you don't mind, could you add that as an issue to the repo. I already have a contributor so maybe someone could pitch in and make it proper cross platform.
Re:Show HN: Chrome Extension to Filter HN Stories by Keyword
by alistproducer2 on Tuesday January 24, 2017 @10:07AM
(#13471853)
thanks for the suggestions. I tend to avoid forEach because of the memory overhead (adds function calls where not really necessary). I guess I'm old school, but never got around to using includes. It's been on my radar for a while. I've always tried to write code that is as portable as possible, even though now, with evergreen browsers in the lead, it doesn't really matter as much.
Re:Show HN: Chrome Extension to Filter HN Stories by Keyword
by nailer on Tuesday January 24, 2017 @10:30AM
(#13472086)
Yeah, .forEach() is a new scope. But the better readability is worth the minor performance impact for everything but the most performance-intensive code.
Re:Show HN: Chrome Extension to Filter HN Stories by Keyword
by nailer on Thursday January 26, 2017 @07:29AM
(#13490767)
"premature optimization is the root of all evil" - Don Knuth
Also old-style for loops in JS fall victim to the last entry effect since people often use them to set up event handlers and wonder why they don't work.
Re:Show HN: Chrome Extension to Filter HN Stories by Keyword
by unchaotic on Tuesday January 24, 2017 @12:24AM
(#13469024)
Somewhat related : Wrote a chrome extension [1] to reduce some noise on twitter. It should be easy to add the ability to filter out tweets by keyword (I'll do it probably this weekend if it is useful).
Re:Show HN: Chrome Extension to Filter HN Stories by Keyword
by nailer on Tuesday January 24, 2017 @09:00AM
(#13471302)
I'd love for Twitter to support shared keyword filters and block lists, rather than the current, web-only, politically driven, content-and-code-combined, filters that exist at present.
Re:Show HN: Chrome Extension to Filter HN Stories by Keyword
by alistproducer2 on Monday January 23, 2017 @11:19PM
(#13468774)
I feel both of you! Feel free to fork it and make it work for whatever site you want. The code base is pretty straightforward. You'd just need to change the DOM logic (which is about 2 loc) so it should be pretty doable.
Re:Show HN: Chrome Extension to Filter HN Stories by Keyword
by cpeterso on Tuesday January 24, 2017 @12:10AM
(#13468965)
Or an extension that understands how to parse many different news sites and can filter out stories on all of them. Add one keyword (pick your own example ;) and see no headlines containing that keyword on any news site. It wouldn't be that hard, though it would reinforce one's own news bubble.
Re:Show HN: Chrome Extension to Filter HN Stories by Keyword
by aryamaan on Tuesday January 24, 2017 @10:02AM
(#13471799)
I would like to make an extension which sorts the stories based upon numbers of comments. How do I start? I have been working as a backend developer and completely agnostic about this stuff. TIA.
Re:Show HN: Chrome Extension to Filter HN Stories by Keyword
by alistproducer2 on Tuesday January 24, 2017 @10:05AM
(#13471828)
If you check the code, contentScript.js:28 that line removes the meta data line, which contains the number of comments. One could easily parse the comment line and use it to rearrange the some, as opposed to deleting it. Fork the code and give it a try!
Re:Show HN: Chrome Extension to Filter HN Stories by Keyword
by elcapitan on Tuesday January 24, 2017 @08:51AM
(#13471244)
Did it work for you? Filtering by title keywords only seems to be rather hard, especially for political stuff, which often uses rather non-descriptive headlines.
Example: "New CIA Chief to Gladly Spy on Americans, Even If Using Info Hacked by Russians" looks like opinionism that I could pretty well live without, but it doesn't contain any keywords I would blacklist.
For technical stuff it's probably a lot easier (just name the language/framework/etc).
Re:Show HN: Chrome Extension to Filter HN Stories by Keyword
by alistproducer2 on Tuesday January 24, 2017 @10:03AM
(#13471808)
Yeah, I ran into something similar. I had "president" on my list and it blocked a story on the president of a company. It's kind of trial and error. That's why I find it useful to see what stories are blocked so you can get a sense for how well your filter is working.
Re:Show HN: Chrome Extension to Filter HN Stories by Keyword
by alistproducer2 on Monday January 23, 2017 @09:47PM
(#13468405)
Version < 0.4 have a bug that filters comments containing words on naughty list. 0.4 has been pushed to webstore but it will take a minute to propagate. If you want fixed version now, pull it from github.
Although filtering out comments could be a feature and not a bug, amiright?
I made this because I'm tired of seeing political flame-stories on here and I hate flagging them or, even worse, going in the threads to complain about them.
With this extension you can make a comma-separated list of words that when matched within a headline, the link is removed from the page before you ever see it.
You can check the console to see what stories are being removed. It's open source so feel free to fork, customize, contribute or whatever.
It can be used to filter anything, so if you can't stand to see another "JavaScript" or "Python" story, you can block those too.
> It's open source so feel free to fork, customize, contribute or whatever.
Could you add a license to the repo then?
Also old-style for loops in JS fall victim to the last entry effect since people often use them to set up event handlers and wonder why they don't work.
[1] https://chrome.google.com/webstore/detail/hackybird/ddlhmpom...
https://chrome.google.com/webstore/detail/hackybird/ddlhmpom...
Example: "New CIA Chief to Gladly Spy on Americans, Even If Using Info Hacked by Russians" looks like opinionism that I could pretty well live without, but it doesn't contain any keywords I would blacklist.
For technical stuff it's probably a lot easier (just name the language/framework/etc).
Although filtering out comments could be a feature and not a bug, amiright?