RottenFlix Live!

I thought I should write an update on where I've gotten with RottenFlix since the last post.

Plans

In my last post, I mentioned some plans that I had for enhancements.

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.

Reality

Well, after banging my head against the wall extensively on both of these issues, I've reached some conclusions.

  1. It's not actually possible to use workers within Greasemonkey. After much experimentation, googling, and finally Stack Overflowing, I had to accept the fact that my dream of a multi-threaded RottenFlix was dead. Bummer.
  2. This one has a happy ending. After a long fruitless journey down the Live Query path, I stumbled upon a short paragraph in a Dr. Nic blog post that shed light on why Live Query wasn't working for me and never would. Luckily, that post also pointed me at setInterval(), which worked beautifully for my scenario. I'm happy to report that RottenFlix now accounts for movie titles that are added to the page dynamically, and it only took 3 lines of code! (Look at the first 3 changes in this diff, if you're curious.)

Plans?

Now that I've settled these issues, I'm not sure where RottenFlix will go from here. I built this thing for myself, and I'm very happy right now with the functionality. It might benefit from some UI polish. We'll see...

2 comments :

aKnutson said...

Dude, you think like me. Only your the one who is the code genius! Thanks for the time you've spent on this project. I wondered why Netflix doesn't just do it themselves. :sigh:

Anyway, good work! Wishing it automatically added the % but, its all better than having to switch tabs and search!

Matt Blodgett said...

Code genius!? I don't know about that. :-)

I, too, wish I could make RottenFlix load all the rating percentages automatically without user interaction, but it just ain't happenin'.