Some information that might be of use to someone, at discount prices.

April 27, 2005

Movie Review Finder Bookmarklet

Category: Movies,Netflix,Software — badsegue @ 8:59 am

background

If you’re a movie fan you probably belong to Netflix or some other online movie rental outfit, or browse Amazon.com for movies to buy. These sites typically have their own reviews, usually from other members. This bookmarklet provides a quick way to find relevant reviews from other online sources.

implementation

This bookmarklet uses the ‘script injection’ technique to load a javascript file into the current browser page. When the script file is loaded it gets the selected text on the page and creates an IFRAME inside a DIV block. By creating these elements on the current page, rather than in a new window, we can circumvent some of the annoying security related browser limitations. The scripts available from slayeroffice.com were very helpful in demonstrating this technique, as well as how to inject a style sheet.

Here is the bookmarklet: Movie Review Finder. Simply drag it to your toolbar or right-click to add to your favorites. Then select some text (a movie title) on a page and click the bookmark. It will prompt you with the selected text. This gives you an opportunity to edit, in case something was missed.

javascript:
(function(){
  var script=document.createElement('script');
  script.src='http://badsegue.org/samples/reviewfinder.js';
  document.getElementsByTagName('head')[0].appendChild(script);
}
)()

You can try it out on this page without adding it to your favorites. Just select this text:
O Brother Where Art Thou?
Then click the bookmarklet link.

You will see a pop-up with the selected text. Here you can edit the text, in case the selection was a little off:

When you click OK you will get an overlay on the current page:

You can get reviews from Google, IMDB, and Rotten Tomatoes. Google comes up by default. Click on the buttons to switch to a different site. Click Close to get rid of the review box.

• • •

April 21, 2005

Improved MSN and Google GPS GPX Waypoint Extraction

Category: GPS,Software — badsegue @ 9:35 am

background


Previously we showed how to pull GPS waypoints from MSN Yellow Pages and Google Maps results using bookmarklets. One solution was Firefox-only, and the other was more reliable in IE. Here we present a solution that is a little more elegant and should work in either browser.

For those using Google Maps, they have now added UK maps. The scripts had to be updated to accomodate the -d.dddddd longitudes.

approach

To support IE the bookmarklets must be implemented using the ‘script injection’ technique. This involves rewriting the head of the HTML page to add a reference to an external script. Firefox has additional security restrictions that prevent injected scripts from doing certain actions, like opening new windows. This version avoids this restriction by writing the GPX file to a DIV block in the current page.

implementation

The new bookmarklets simply contain the code necessary to inject the external script into the page. Just right-click or drag them to add to your favorites/bookmarks. To use them visit the appropriate page and select the bookmark.

Here is the new MSN GPX RIP bookmarklet, and the code:

javascript:
(function(){
var script=document.createElement('script');
script.src='http://badsegue.org/samples/msngpxripdiv.js';
document.getElementsByTagName('head')[0].appendChild(script);
}
)()

Here is the new Google GPX RIP bookmarklet, and the code:

javascript:
(function(){
var script=document.createElement('script');
script.src='http://badsegue.org/samples/googgpxripdiv.js';
document.getElementsByTagName('head')[0].appendChild(script);
}
)()
• • •

April 13, 2005

Announcing the Thumbnail Image Grabber

Category: Photo,Software — badsegue @ 9:29 pm

The Thumbnail Image Grabber is now available, at version 0.50. View the program’s page for more details.

• • •

April 9, 2005

Netflix Queue Shuffler: Randomize or reverse your queue with bookmarklets

Category: Netflix,Software — badsegue @ 8:38 am

update – April 22, 2009

This script hadn’t worked properly for a while. Its been tweaked so give it a try. It should work if you have drag-n-drop enabled or not, and works in both the normal and the instant queues.

background

A Netflix queue tends to show some clustering of movie types, due to the way people add one movie then add a similar suggested movie. If you want to restore some variety it can be tedious to move things around. Here’s a little tool to randomly re-order your Netflix queue.

approach

This is another task well suited for a bookmarklet. The page layout is straightforward, and only needs to manipulate the values of input fields. The code can be implemented in a few hundred bytes, so only one version is required to support IE and Firefox, without resorting to script injection.

implementation

The queue items are in a form. There are 3x+2 input fields in the form; the first and last are the submit buttons. The other fields are triplet groups with the position field, original position (hidden), and the remove checkbox. Here is the code:

javascript:
(function(){
  var items=document.forms[1].getElementsByTagName('input');
  var os=[];
  for(i=0;i<items.length;i++){
    if(items[i].className=='o'){
      os.push(items[i]);
    }
  }
  var total=os.length;
  for(var i=0;i<total;i++){
    os[i].value=Math.floor(Math.random()*total);
  }
  alert(total+'%20shuffled.%20%20Update%20Your%20Queue%20to%20save.');
}
)()

Here is the bookmarklet link:
Netflix Shuffler

Add this to your bookmarks/favorites by right-clicking or dragging it to the toolbar. To use it just navigate to your Netflix queue page and select the bookmarklet. The queue will be shuffled, then just click Update Your Queue to commit the changes.

bonus

Here is a slightly modified version that simply reverses the queue order. This might be useful if all the new releases are at the end and you want to see those first.

javascript:
(function(){
  var items=document.forms[1].getElementsByTagName('input');
  var os=[];
  for(i=0;i<items.length;i++){
    if(items[i].className=='o'){
      os.push(items[i]);
    }
  }
  var total=os.length;
  for(var i=0;i<total;i++){
    os[i].value=total-i;
  }
  alert(total+' reversed.  Update Your Queue to save.');
}
)()

Here is the bookmarklet link:
Netflix Reverser

• • •
Next Page »