You are viewing...

Chrome Extension: HackerNews News Recommender

Updated on February 26, 2012 at the 07th hour
Posted under:

DISCLAIMER: Expressed views on this blog are my own.

Update [11/03/12] Posted to Chrome Web Store


Update [11/02/12]: Looks like Chrome is blocking installation of my extension, which is fine. You can download the git repository and install from the extensions dashboard until I post to the webstore.

Download Link.UPDATE: Git source here: #2: v0.2.3 is out. Click download above!

I have finally gone and done it! I thought of a really cool way to create a recommender using a statistical algorithm of choice, so I chose the easiest one: the Naive Bayes classifier! After so much frustration, this has been a good project!

You can see the posts recommended to me are highlighted.

What does my extension do exactly? In a nutshell, find interesting posts for you based on your past interests. Your past interests would be the posts you've clicked on. The more posts you click on, the better the recommendations.

How does it do it? Well, I thought of two things, gathering data and training the Naive Bayes classifier.This requires a persistent datasource, user to label the dataset and have the classifier trained on the data set.
  • I decided Local Storage was the way to go, it is really really simple. Simple as getItem, setItem, and removeItem makes my life easy!
  • I really want to make the labeling as simple as possible, so I used the delegate listener from jQuery to listen in on clicks to the posts. When you click on a post, it is saved onto a data structure and then saved into localstorage.
  • The training happens when you click on the more link. The next page should show the current/updated recommendations.
  • Title/Urls are not counted twice. Every post is a one time affair!

Considering that I finally got something working, I am working to polish and then publish this thing. I sort of fudged some values and need to look more into how the weighting is factored in. Weights are needed because there will always be more non-interests than interests, so the posts you click will need a high weight.

I'm hosting it right now! Come and get it! Download. It should start recommending after clicking the "more" link (you know go to the next page) twice. Maybe I'll add a notification of when it starts to recommend things, its a one time affair though unless you reset the data. No data is collected by me, everything works on your computer/browser.
You just read "Chrome Extension: HackerNews News Recommender". Please share if you liked it!
You can read more recent posts here.