Rotten Tomatoes + Netflix + Greasemonkey = RottenFlix

I give you RottenFlix, my first published Greasemonkey script.

What is it?

RottenFlix is a result of the time-honored tradition of scratching your own itch. I'm a huge movie fan and a devoted member of Netflix. I've also been a user of Rotten Tomatoes for many years and have come to rely on it heavily for movie ratings; I'll rarely commit to watching a movie until I've looked up its rating on RT. While browsing Netflix for intriguing movies, it became tedious and annoying to have to constantly leave the site to look up ratings on RT, so I developed RottenFlix to alleviate this pain by making RT ratings available in the Netflix interface with a single click.

You can find more details as well as screenshots here.

What I learned

Along the way, I learned a great deal about Greasemonkey and its various oddities, including integrating third-party JavaScript libraries, and troubleshooting cross-domain Ajax requests with GM_xmlhttpRequest. I picked up a few new jQuery tricks as well.

Caveats

One thing to be aware of if you install RottenFlix: because Rotten Tomatoes does not have an API for fetching movie ratings, I had to reverse-engineer the scheme that they use to map movie titles to URLs on the site. So I essentially have to make certain guesses that are not always correct, though I'd say at this point that my code guesses correctly about 90% of the time. When a guess is incorrect, you'll see a little "?" where the rating would normally appear, and by clicking the "?" you'll be taken to a search results page for that movie title on RottenTomatoes.com where you can easily find the correct movie yourself.

Plans

In the future, one major enhancement I'd like to make to RottenFlix is to redesign it to use Web Workers. My original design of RottenFlix fetched all relevant movie ratings up-front with no action required from the user, but it was just too slow and it blocked the UI awkwardly. With Web Workers I'm pretty confident I could go back to my original vision and make it fast and usable.

There's also the issue of new movie titles that are brought into the page via Netflix's own Ajax effects. RottenFlix does not currently handle those movie titles. I could probably make this work, but I'm not sure how.