You probably knew this was coming sooner or later. DEV.TO has been filled with listicles lately and something had to be done.
But before we contin...
For further actions, you may consider blocking this person and/or reporting abuse
Here's a regex that seems to give good results (very few false positives/negatives from some quick testing). I've added comments and whitespace to make it easier to read/improve:
Usage:
Example results:
This looks good! I am checking words before the number and after the number, along with emojis and other positions (you can check the source code on GitHub). If you think my version can be improved please improve it and I'll merge your code!
@lnahrf Sure thing, I opened a PR (with a couple of improvements to the regex vs the original one I posted)
Merged your PR and added you to a contributors list. Looks super, thank you.
Your method of writing RegExps has made my day. Thanks!
Glad you like ;) this way of writing regexes is inspired by Ruby's
x
regex flag. If you're interested, I also published a package a while back that implements a more robust version of this whitespace/comment stripping logic, plus a few other features:fancy-regex
Interesting! Yes, have written a few rx utility functions in my time. Daniel Roe of the Nuxt team also has Magic RegExp: regexp.dev/. I'm pretty handy with RegExps myself, but will take a look at your lib for sure. Thanks again!
There is a Regex Jedi among us mere mortals. Or just me.
Seriously, this might be the most useful piece of software that EVERY senior DEV user MUST install in 2024. ๐คฃ praising even before I tried, but THANKS so much already! I had been thinking of coding something similar but I didn't have time yet. Thanks for your contribution!
Haha, thanks for the support!
Hi from the DEV team!! Love this. Thank you for sharing and for coming up with some really great solutions to help us out, while we work on some larger solutions. Be very well!
Glad you liked it! ๐
Sooner or later?
In fact, aside from listicles, I haven't been able to find interesting articles here lately.
Interesting topics are scarce as well.
Lately, I've been thinking about some Java tricks used in my work and topics like SQL optimization using indexes have come to mind.
The problem I see with listicles is that most of them don't provide me with new information.
However, if someone were to publish listicles of the same caliber as tools of the Titans, those articles would probably be very intriguing.
Yes! I am not against the principle of a listicle (it rhymes, lol).
It's just that the listicles that we see on the top of the feed are just posting irrelevant content over and over again, not providing any additional value.
Even beyond listicles, we are lacking high quality articles.
I'm seeing some errors reported in Chrome, under manage extensions, after I add this unpacked extension.
I'm struggling to discover what may be causing this, as I usually run an up-to-date Chrome. Seems to work great anyway. I'll raise an issue on GitHub for reference.
Commented on your GH issue, thanks!
I am not sure what the issue is myself, will have to dig into the manifest documentation.
How did I miss this?! This is wonderful, Lev, haha!
๐ Thanks Michael! Glad you liked it
Looks great, will you publish it in the chrome extension store?
If enough would ask for it, then yes. Let's see what others have to say.
Interesting solution.
I definitely tried messing around with the Chrome extension API once but kind of gave up. The listicle problem on DEV is definitely annoying, I kind of miss those longer articles with an interesting story to recount or blog posts and the like.
Cheers
Yea it got easy once I grasped that the extension and DOM are two different threads that can only speak with each other using messages (which makes sense, security wise).
Thanks!
Awesome! I've made an extension for myself that does this already, but chose not to share it. Yet. Great article!
Wow, such a brilliant idea! ๐ก I really appreciate the creative response to the problem. ๐
Thank you for the support!
Thanks for commenting, I completely understand your frustration. Hopefully the DEV team can work on some larger-scale solutions, but in the meantime we have this add-on. Other developers have already improved the source code, so you should definitely try it out.
Thanks for creating a possible solution for listicles @lnahrf! :) Hopefully, it will inspire other developers to come up with other ideas! :)
Thank you for the support! Other developers have already contributed to the repository ๐
Great work, but why call it "Chrome add-on"? it works just fine on Firefox too... and probably most other browsers!
I had absolutely no idea! Thanks for that.
Run "git pull" to get recent changes ๐
These bloody listicles have triggered the whole new holy war around ๐ the next post will be how to build unblocker for the browser extensions blocking the listicles ๐คฃ come on guys, you can just skip reading them. Also some of them are not this shitty actually.
They always take the top place in my feed, so I made this
The idea itself is very cool, don't get me wrong. I try to filter out my feed in settings as much as possible as well, but the DEV's filters work not ideally. Especially in terms of user blocking, for instance. Probably it'd make sense to make a separate extension for that as well ๐ Or even separate DEV ui based on DEV's API... OK, that's probably too much ๐
Hahaha, we do tend to over-engineer solutions so I wouldn't be surprised if that actually happens.
Uh oh, I get an error:
@lnahrf
Did you follow the build steps written in the readme?
Oops no, sorry. It works great now. Thanks!
If I were to post a listicle, I would just copy paste the regex from here and ask ChatGPT to adjust my title to bypass it ๐ซฃ๐
You'd have to have a very non-listicle title then, which will require some work and perhaps iterations. So I am okay with that.
"8 browser extensions to remove listicles from your DEV.TO feed in 2024"
Interesting add-on, but considering I primarily go for the listicles when reading on dev.to and elsewhere, definitely not something I'd use.