Userscript to remove read news
So, I’ve been dabbling with Javascript in a very serious way right now. For one, I’m taking the Advanced Web Programming class where we are officially learning the language. I have to admit, I am getting to learn new ways of doing things and realizing what a jarhead way of programming javascript I’d learned by myself. But, I digress. This is just a little userscript that I cooked up to test a few things:
1. Use jquery
Since I don’t do javascript in a sustained manner, I tend to forget jquery. Also, I tend to avoid using extra pieces of code whenever possible (even when they are as small as jquery lib) for small things. I had to learn to get more efficient with jquery.
2. Use Greasemonkey + jQuery
This part was harder than I thought. Naturally, I used the latest and greatest jQuery version (1.4.1 as of Feb 15,2010). There’s a little browser snooping going on there that greasemonkey sandbox hates and stops. I eventually settled for 1.3 version.
3. The main reason: remove the news items I’ve read
I generally frequent slashdot, news.ycombinator.com (hacker news for the unenlightened ones
) and reddit. I just figured it makes no sense to look at news I read already. I kind of does if you want to look at the up votes. But I personally don’t care.
Now that I’m done with my little spiel.. Here’s the code. Cheers.. http://gist.github.com/raw/304474/49c64624da9f04e0698e65c30a5c30224bcbf265/hide_read_news.user.js
I love Gist on github. I’ll hopefully get more sites in the list.












