Netflix Queue Manager Bookmarklet
background
Managing your Netflix queue can become unwieldy once you add more than a few dozen items. We previously provided bookmarklets to shuffle and reverse the queue, which is more of a novelty than a useful feature for most. There are a few desktop clients that are available now that provide an alternate interface with most of the functionality of the web interface, as well as some enhancements not available on the web side. I’m primarily concerned with improving the queue management features, which is the most tedious aspect of the web interface. Some of the features that are needed:
- Move to top - this is provided but requires a full page refresh. Not effective for large queues.
- Move to bottom - not provided at all.
- Drag and drop - there is a limited capability to do this when a movie is added, but only within the top 10 items.
- Sort - by star rating.
- Shuffle, Reverse - for people who like suprises.
approach
Instead of creating a separate application, I’ve taken the approach of augmenting the standard web interface with a bookmarklet. A bookmarklet is a just some javascript that can be “bookmarked”. Clicking on the bookmark allows the javascript to run in the context of the current page, to do something useful to the page.
The shuffle and reverse functions had already been addressed, but need to be adapted to the new tool. The drag and drop, top, and bottom functions are more complicated and require the ability to target specific items on the page. I searched around and found a few DHTML libraries that can be used to provide the drag and drop capability. There are some very nice packages out there, such as the ones from walterzorn.com and tool-man.org. I found the one from walterzorn.com to have more features, but due to the way it is invoked is unsuitable for use in bookmarklet applications that occur after the page is loaded. The ToolMan library doesn’t have that issue, and provides all the features I needed so it is the choice here.
installation
The script needs to be installed first. This is simple, just drag or right-click the link below to add it to your toolbar or favorites. Then it becomes a bookmarklet.
The link is just this code:
javascript:
(function(){
var script=document.createElement('script');
script.src='http://badsegue.org/samples/toolman.js';
document.getElementsByTagName('body')[0].appendChild(script);
var script=document.createElement('script');
script.src='http://badsegue.org/samples/netflix-manager.js';
document.getElementsByTagName('body')[0].appendChild(script);
}
)()
When activated the bookmarklet will load the ToolMan library and the Netflix Manager scripts and act on the currently displayed page.
usage
Visit your Netflix queue page. Just click the Netflix Queue Manager bookmark that you just installed. The Manager will be overlayed onto the Netflix page.

From here you can drag and drop any row, and use the menu buttons at the top and bottom of the overlay. When you are finished use the CLOSE button to close the Manager. The position numbers on the Netflix page will be updated to reflect the positions selected in the Manager. Just use the Update Your Queue button to commit the changes.

conclusion
This tool should provide just about all the features you need to manage the queue. Some final notes:
- There is no delete button, but that can be done easily enough from the standard page.
- Sorting puts any personally rated movies at the top, followed by reccomendation ratings, followed by series discs. The series discs only have ratings on the first in the series so it’s difficult to place those discs in the proper context.
- You may encounter a script error when activating the Manager. Try the bookmark again. There may be timing issues when fetching and loading the two scripts. After the first load the browser should have cached the files. I only encountered this problem once, when using IE.
- There may be some untested conditions. I had to tweak the script after encountering various queue conditions, like Friend icons, series discs, top 100 icons, etc. You may have some combination of things in your queue that I couldn’t test.
This looks pretty cool, however, with Firefox 1.0.4 on Fedora Core 3, I’m getting an error of “document.getElementById(n) has no properites at line 54 of http://badsegue.org/samples/netflix-manager.js
Any help?
Comment by Keith Garner — May 26, 2005 @ 9:59 pmKeith - I’m guessing something in your queue is throwing off the parsing. Can you save your queue page and email it to segue @ badsegue.com. Thanks.
Comment by badsegue — May 26, 2005 @ 10:17 pmWill do. Just keep in mind, any crappy movies are in the queue because of my wife. Don’t hold it against me! :)
Comment by Keith Garner — May 26, 2005 @ 11:03 pmI found that the script didn’t work for secondary queues, only the primary one. For some reason there is a different naming scheme for the elements on those pages. I updated the script to find the appropriate elements by position in the DOM rather than by name.
It should work now for both types of queues. You don’t have to re-install anything.
If you’ve already used the script once you mayneed to force a refresh because the old version is cached by the browser. Try it first, and if you are encountering errors do this to get the cache refreshed:
1. Load this page in the browser : http://badsegue.org/samples/netflix-manager.js
2. Refresh the page (CTRL-R works).
3. You should see “version 1.1″ around line 3.
The script should work now. If you are getting errors you can save your queue page (as HTML only) and email me the file and I will try to debug the problem.
Comment by badsegue — May 27, 2005 @ 8:44 pmOMG this rocks! Thank you, thank you, thank you! I have been begging Netflix to do drag-and-drop queue ordering for years.
Comment by Sara — May 28, 2005 @ 5:18 amHey badsegue, I posted about your bookmarklet on a Netflix discussion group, and some people have brought forth concerns about the security of their accounts. Do you have any information about how this works that might ease their concerns?
Comment by Sara — May 31, 2005 @ 9:21 amSara - The script just adds new HTML to the page, by parsing the exising queue page. Everything happens in the context of the current page, which doesn’t have any sensitive data. Bookmarklets are pretty safe as they are constrained by the browser. The browser has some inherent security features to prevent one page from accessing data that may be open in another window, and from interacting with resources from another domain. They are also completely open, so anyone can view the script source and check for problems.
Comment by badsegue — May 31, 2005 @ 6:50 pmJust got a chance to try your updated version, its working perfectly. Great work, man!
Comment by Keith Garner — May 31, 2005 @ 7:33 pmIt ought to be possible to skip some steps and have the greasemonkey script hide netflixes queue, insert your drag/droppable one in its place and then have the ’save’ button send the neccesary info to netflixes form to reorder it. It is cool now, but having it seamlessly integrated would be the icing on the cake. I have my own slate of netflix greasemonkey stuff to figure out but I figured I’d just mention this idea to you. It really shouldn’t be tough at all.
Comment by jer — June 7, 2005 @ 8:19 amjer - I held back on some of the automation that could be done. After reading some of the feedback on another forum I found that some people are very protective of their queues, and are afraid of what the script might do to it. The manual commit step lets them stay comfortable with what the script is doing. That should also keep me from getting sued when someone loses their 500 movie queue. :)
Comment by badsegue — June 7, 2005 @ 9:09 am