Lojic Technologies

Archive for August 2007

Greasemonkey Script for Netflix Half Star Ratings

with 3 comments

I wrote an article back in May about a way to give half star ratings on Netflix. It had the advantage of working in any browser and not requiring any software installation, but it wasn’t very user friendly.

Since then, I’ve been doing a lot of JavaScript coding, so I thought I’d give Greasemonkey a try. I found a script here to give half-star ratings, but I didn’t care for the hover captions and JSLint pointed out a few issues, so I cleaned it up a little:

Code

// ==UserScript==
// @name Netflix Half Stars
// @description allows half star user ratings on Netflix
// @include http://*netflix.com/*
// ==/UserScript==
// http://userscripts.org/scripts/review/8118
// Modified by Brian Adkins

if (!unsafeWindow.sbHandler) { return; }

var sbHandler = unsafeWindow.sbHandler;
sbHandler.sbOffsets = [8,18,27,37,46,56,65,75,84,94];

sbHandler.displayStrings[0.5] = ".5 stars";
sbHandler.displayStrings[1.5] = "1.5 stars";
sbHandler.displayStrings[2.5] = "2.5 stars";
sbHandler.displayStrings[3.5] = "3.5 stars";
sbHandler.displayStrings[4.5] = "4.5 stars";

sbHandler.sbImages[0.5] = new Image();
sbHandler.sbImages[0.5].src = sbHandler.imageRoot+"stars_2_5.gif";

for(var i = 2; i < 11; i++) {
sbHandler.sbImages[i/2] = new Image();
sbHandler.sbImages[i/2].src = sbHandler.imageRoot + "stars_2_" +
(Math.floor(i/2)) + (i % 2 === 0 ? "0" : "5") + ".gif";
}

sbHandler.getStarCount = function (evt) {
var x = unsafeWindow.getElementMouseCoordinate(evt, this.element);

for(var ii = 0; ii < 10; ii++) {
if(x <= this.sbOffsets[ii]) { return (ii + 1) / 2; }
}

return 0;
};

Installation

Save the JavaScript code with .user.js extension e.g. netflix_halfstar.user.js and then open that file in Firefox and Greasemonkey should prompt you to install it.

Written by Brian Adkins

August 27, 2007 at 4:38 pm

Peter Seibel: Coders at Work

leave a comment »

Peter Seibel is working on a book, “Coders at Work”, that will “contain interviews with around sixteen of the most interesting computer programmers alive today”. He has a page that lists 284 programmers, with links to more info on each one, that I think is worth perusing:

284 Coders

Peter is the author of Practical Common Lisp which I highly recommend.

Also see his Google Talk on Common Lisp.

Written by Brian Adkins

August 27, 2007 at 12:39 pm

Posted in books, programming

Tagged with ,

Ruby Hoedown 2007 Videos

leave a comment »

I noticed on Rick DeNatale’s blog that the videos for Ruby Hoedown 2007 are now available.

Written by Brian Adkins

August 20, 2007 at 1:12 pm

Posted in communication, video

Tagged with ,

Animator vs. Animation

leave a comment »

Here’s an awesome animation by Alan Becker. The youtube version below is a little fuzzier than the original. A lot of work went into this. Thanks to Craig McDowell for passing this along.

Written by Brian Adkins

August 15, 2007 at 7:49 pm

Posted in entertainment, video

Tagged with , ,

How Bill Gates Beat Gary Kildall

leave a comment »

Robert Scoble has created three video interviews with Tom Rolander (and a few other folks) dealing with early PC industry history. Who is Tom Rolander? He’s the guy who was flying with Gary Kildall when IBM came calling. The end of the story is that Microsoft got the OS deal with IBM. The video series fills in some of the blanks 🙂 Aren’t familiar with this story? You should read: Hard Drive

A couple other good tech history books are:
Nerds 2.0.1 and
Dealers of Lightning

Part One

Part Two

Part Three

Written by Brian Adkins

August 13, 2007 at 1:50 pm

Posted in books, technology, video

Tagged with

Social Bookmarking

leave a comment »

Here’s a video that explains why using a site such as del.icio.us can be useful. I think they may have failed to mention that you can mark bookmarks as private on del.icio.us, so it’s not necessary to expose your bookmarks to the world. However, in my case, I only mark a small fraction as private.

I’ve been using del.icio.us for quite some time. After I had been using it for a while, I realized that it had been a long time since I bookmarked something in my browser because I had developed a habit of bookmarking in del.icio.us. Most browsers force you into placing a bookmark into a hierarchical, or directory, structure, but on del.icio.us you can assign as many “tags” as you like to a particular bookmark so you can search for things more easily. del.icio.us also allows you to export your bookmarks so you aren’t at the mercy of a proprietary service.

Another thing that is handy is to subscribe to the del.icio.us feeds of your friends to be automatically notified when they bookmark something that may be of interest.

Written by Brian Adkins

August 7, 2007 at 8:34 pm

Posted in internet, video

Tagged with , ,