Show HN: Chrome Extension to Filter HN Stories by Keyword(github.com)
github.com
Show HN: Chrome Extension to Filter HN Stories by Keyword
https://github.com/ShamariFeaster/chrome-extension-hn-filter
28 comments
Good idea, thanks for making it!
> It's open source so feel free to fork, customize, contribute or whatever.
Could you add a license to the repo then?
> It's open source so feel free to fork, customize, contribute or whatever.
Could you add a license to the repo then?
added a GPL. thanks for reminding me.
I thought about making something like this to filter out Apple stories actually. I use Firefox, might try and load this as a web extension.
Loaded, but didnt show the icon in the bar.
it uses an API that doesn't exist in Firefox to only trigger on news.ycombinator.com
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.
Rad! You might be able to save a little time/logic by updating the JavaScript from ES3. Instead of:
if(thisText.indexOf(thisWord) > -1)
You can just do: if ( thisText.includes(thisWord) )
Likewise... for(let i = 0; i < entries.length; i++){
Can be replaced with: entries.forEach(function(entry, index){
Chrome supports both the relevant parts of ES6 and ES5 out of the box.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.
Yeah, .forEach() is a new scope. But the better readability is worth the minor performance impact for everything but the most performance-intensive code.
I'd love to see an extension like this for Twitter.
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).
[1] https://chrome.google.com/webstore/detail/hackybird/ddlhmpom...
[1] https://chrome.google.com/webstore/detail/hackybird/ddlhmpom...
Updated extension should now let you filter tweets based on keywords (& also sort tweets by popularity...)
https://chrome.google.com/webstore/detail/hackybird/ddlhmpom...
https://chrome.google.com/webstore/detail/hackybird/ddlhmpom...
I actually wrote something like that already: https://chrome.google.com/webstore/detail/social-muter/pipnn... Enjoy!
For some reason, the screenshot on the socialmuter.com home page doesn't load in Firefox or Edge.
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.
And Facebook!
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.
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.
I actually thought about something similar last night. Have a project that had a plugable DOM parser so people could build plug ins for various sites.
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.
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!
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).
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).
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.
Great, now I can de-Trump my feed.
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?
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.