Last updated

IMDB 0.3.0 now including console utility - query IMDB from your console

With the release of IMDB 0.3.0, a command-line utility is included!

Why is this awesome for you? Basically, because you can now query IMDB and process the results with any of the great GNU tools available to you like grep.

Let me show you:

Search IMDB

 1$ imdb Star Trek
 2>> Searching for "Star Trek"
 3 > 0060028 | Star Trek (1966) (TV series)
 4 > 0796366 | Star Trek (2009)
 5 > 0092455 | Star Trek: The Next Generation (1987) (TV series)
 6 > 0112178 | Star Trek: Voyager (1995) (TV series)
 7 > 0106145 | Star Trek: Deep Space Nine (1993) (TV series)
 8 > 0117731 | Star Trek: First Contact (1996)
 9 > 0084726 | Star Trek: The Wrath of Khan (1982)
10 > 0092007 | Star Trek IV: The Voyage Home (1986)
11 > 0079945 | Star Trek: The Motion Picture (1979)
12 > 0244365 | Enterprise (2001) (TV series)

For clarity, only the ten first search results are shown. I’m thinking of including an option to set the number of returned titles. Let me know what you think about that.

Getting movie details

So, let’s pick a movie we want to get details about.

 1$ imdb 0796366
 2>> Fetching movie 0796366
 3
 4Star Trek (2009)
 5========================================================================
 6Rating: 8.4
 7Duration: 127 minutes
 8Directed by: J.J. Abrams
 9Cast: Chris Pine, Zachary Quinto, Leonard Nimoy, Eric Bana, Bruce Greenwood
10Genre: Action, Adventure, Sci-Fi
11A chronicle of the early days of James T. Kirk and his fellow USS Enterprise crew members. |
12========================================================================

Combine with GNU commands

Or, as mentioned earlier, you can combine it with other console commands. So to get the rating of a movie, do this:

1$ imdb 0796366 | grep "^Rating" | cut -d" " -f 2
28.4

Installation, source and issues

I’m still working on perfecting the console output, so if you have any tips, please report it in the form of an issue.

You can get this as a Ruby Gem with

1sudo gem install imdb

The source is also available at http://github.com/ariejan/imdb.