From: pdbogen Date: Wed, 2 Feb 2011 18:57:22 +0000 (+0000) Subject: Add an IMDB lookup module. X-Git-Url: http://git.mmlx.us/?a=commitdiff_plain;h=43e7d88fce7213dac810bda467d2593ba4084c2f;p=destult.git Add an IMDB lookup module. git-svn-id: https://www.cernu.us/~pdbogen/svn/destult2@113 088b83a4-0077-4247-935c-42ec02c2848b --- diff --git a/commands.yaml b/commands.yaml index 0d5d530..29a0d27 100644 --- a/commands.yaml +++ b/commands.yaml @@ -2113,3 +2113,15 @@ DETWITTER: |- $kernel->post( $src, $replypath, "I have no access token for your account.", $dest ); } } + +IMDB: |- + sub { + my( $kernel, $heap, $who, $what, $src, $dest, $replypath ) = @_; + use IMDB::Film; + my $imdb = new IMDB::Film( crit => $what ); + if( $imdb->status ) { + $kernel->post( $src, $replypath, $imdb->title()." (".$imdb->year()."): ".join( ', ', @{ $imdb->genres() } )."; Rating ".(scalar $imdb->rating()).": ".$imdb->storyline(), $dest ); + } else { + $kernel-post( $src, $replypath, "An error occured: ".$imdb->error, $dest ); + } + }