The Lumber Room

"Consign them to dust and damp by way of preserving them"

Where Have I Seen…

with 9 comments

I have, for a long time, dreamed of a Firefox extension that would do this. Now, finally, empowered by Greasemonkey, I wrote one myself. (Technically, a Greasemonkey user script is not a Firefox extension, but it can be easily converted into one, and a Greasemonkey script is the Right Thing anyway.)

What it does: on any IMDB cast listing, show for each actor what other movies you have seen him/her in. Here’s a screenshot:

Clearly there is a lot of work left to do, but it took less than half a day to learn Greasemonkey (and parts of JavaScript) and write it, and it’s already usable! By me, that is.
[The following was true at the time of writing but is no longer true.] I don’t know if anyone else would be interested in this, but it currently won’t work anyway except when running on my laptop. This is its crazy “design”: on any IMDB page with a cast listing, it first looks for each actor on the page, and extracts their ID. (Reasonable so far.) To find their other movies, it then makes a xmlhttp request to a PHP script running on my laptop, which then calls a Python script and returns its raw output inside ‘pre’ tags. Now you know. The reason for this nonsense is that there was no JavaScript API/library for IMDB while there was one for Python, so it was really easier to just use the latter, and the only way available of interacting with the “outside world” from a Greasemonkey script is through xmlhttp requests, and…
Anyway it’s not all that hard to parse each actor’s “other movies” through JavaScript myself, if that’s all I’m doing, so I might get to that eventually. (I also considered keeping IMDB’s data locally and parsing the text files, but they’re huge and not very well-formatted: No IDs, for example.)

It’s currently named “WHIS”, can you think of a better name? :)

Update: It’s now a full-fledged Greasemonkey script, and is up on userscripts.org.

About these ads

Written by S

Sat, 2008-08-09 at 06:41:02 +05:30

Posted in Uncategorized

Tagged with , ,

9 Responses

Subscribe to comments with RSS.

  1. Crazy and cool at the same time. :-)
    You don’t need to parse the plain text data files provided by IMDb by yourself: IMDbPY gives you two options to store the data locally: using the “sql” and the “local” data access systems (hint: use “sql”).

    After that, you can use IMDbPY to search for the _names_ you got (if the local db is up-to-date you can search for the the _title_ of the movie, directly); most of the time you’ll get the right person/movie as the first result of the query. :-)

    Bye!

    Davide

    Sat, 2008-08-09 at 10:52:03 +05:30

  2. Thanks! (And thanks for IMDbPY too, good package and sufficiently good documentation :) )

    I hadn’t studied IMDbPY’s non-http access methods closely… Putting the entire IMDB into a local sql DB will be useful!
    I am somewhat queasy about searching with names, but given that that’s apparently how IMDB does it, it’s probably okay :)

    Shreevatsa

    Sun, 2008-08-10 at 00:47:27 +05:30

  3. Neat! Do develop it into a full-fledged extension.

    I have a couple of suggestions too. Wouldn’t it be better if the movies shown came as links instead of plain text? And regarding the movies shown across each actor’s name: what’s the current criteria for their selection? How about having the highest ranked movies that the actor was a part of?
    (I help so well, don’t I? Increasing potential workloads with such ease :)

    And when you have the time and the inclination, think of an extension that gets the photo of an actor from IMDB when there’s no free image of the person available on wikipedia. (I’m guessing that this is considerably easier.) You must’ve come across that annoyance before, yes?

    PS

    Wed, 2008-08-13 at 20:07:19 +05:30

  4. Yeah, the plan is to make the movies links (instead of <pre> text), and possibly order the movies by rating. (There are at most a few movies for any actor, at least for me.) The problem is that I find working with web pages and JavaScript a real pain, even though I’m trying to convince myself it’s not so bad (see previous post ;))
    I’ll probably get to it eventually…

    The hard part about the IMDB-Wikipedia thing, probably, is figuring out when one is on the Wikipedia page of an actor, and whether the page has a photo or not… I’ll look into it after my all-important qualifying exams are over next week :)

    BTW there might already be a script for what you want on Userscripts

    Shreevatsa

    Thu, 2008-08-14 at 02:14:48 +05:30

  5. Hi,

    I saw your script over at userscripts.org and love the idea. However there seems to be a bug: Each time I open an actor link on a movie details page with the middle mouse button in a tab the tab just loads and loads and nothing else happens.

    Is there a way to fix this?

    Thanks,

    Max

    Max

    Sat, 2008-11-22 at 16:12:42 +05:30

  6. Also, than I click on the plus sign in the actors filmography it changes to “Adding…” but just stays that way.

    Max

    Sat, 2008-11-22 at 16:18:01 +05:30

  7. Oh.. that is strange. It works fine here… what OS/Firefox version are you using? Also, what other scripts do you have installed?

    Maybe we should carry out this discussion on the userscripts.org discussion threads…

    Shreevatsa

    Sat, 2008-11-22 at 16:48:42 +05:30

  8. Oh, thanks for the tip with the other scripts. I deactivated some of them (one that shows the actors age, and one that inserts the movies rating) and now it works just fine :-)

    Max

    Sat, 2008-11-22 at 22:24:03 +05:30

  9. Oh… what were the other scripts? If possible, I’ll try to update my script to not interfere with them :-)

    Shreevatsa

    Sat, 2008-11-22 at 22:26:21 +05:30


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 68 other followers