Monday 5 November 2007

Films list is back

Rather than pollute and bore people with films list in my blog (I'd rather do that with useless trivia, and self-deprecation), I thought I'd use IMDb's My Movies feature.

The hardest part was getting all the films from a variety of sources into the database, without having to click through all of them. Here comes the Mechanizer (in US English in the text). Given a list of @imdb_ids:

my $mech = new WWW::Mechanize;
$mech->get( "" );
$mech->success or die "Can't get the login page";

form_number => 2,
fields => {
login => '',
password => "mypassword",

my $id;
foreach $id (@imdb_ids) {
print "Adding $id\n";
$mech->get ("$id");

I used my old code from code to grab the IDs from blogs, and various types of files. HTH.


Johan Dahlin said...


Is it possible to sort by the date you add/vote though?

You're still short 100 movies or so to my list:

Bastien Nocera said...

And I cheated, I also have TV series on there.

Vicky said...

Is 'Secret Diary of a Call Girl' good? I really wanted to watch that!

Bastien Nocera said...

Vix, yeah, bit kinky. You can see more flesh on French TV at 8 though.