Showing posts with label imdb. Show all posts
Showing posts with label imdb. Show all posts

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( "http://www.imdb.com/register/login" );
$mech->success or die "Can't get the login page";

$mech->submit_form(
form_number => 2,
fields => {
login => 'email@test.com',
password => "mypassword",
},
);

my $id;
foreach $id (@imdb_ids) {
print "Adding $id\n";
$mech->get ("http://www.imdb.com/rg/title-lhs/mymovies/mymovies/list?pending&add=$id");
}

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