For the longest time I’ve wanted to do a plugin for IMDb, but unfortunately, they don’t offer any kind of API to tap into, which would mean doing a whole bunch of screenscraping, which to be honest, I really couldn’t be bothered to do. Now, IMDb still doesn’t offer any kind of API, but I was on CodePlex the other day and found someone has been writing a wrapper for IMDb that does all the screenscraping that I would have to have done. Great So I started playing around, working out what I would want for my plugin, and I came up with this:
It’s very easy to use, there are two methods in which you can get the film details, you can either search for the film you want, or if you have the IMDb link, you can paste the link in and get the relevant details:
So now that you have the film information you want, you can choose what parts of it to put in your blog entry, so if you didn’t want the description to appear, just untick it and it won’t appear. Once you’re ready to insert, hit Insert and you’ll get something like this:
Easy huh. Now, when it comes to what information you want to show, I have given three predefined templates, or you can choose a custom option:
Now, as I mentioned, I’m using the IMDb wrapper from CodePlex, but I had to make a slight alteration to its code for use in the plugin, so the plugin itself comes with a slightly custom build of the wrapper. All I did was change the following line of code from:
Wc.Proxy = Nothing
Wc.Proxy = PluginHttpRequest.GetWriterProxy()
This makes sure my plugin carries on like my other plugins in using Writer’s proxy settings so it can be used behind a proxy. As the source code for the original wrapper is Open Source, I have also included the modified source code within my own project page on CodePlex.
I should however note that the wrapper was written in .NET 3.5 which means for my plugin to use it, it had to be built in .NET 3.5 too, which was kind of annoying, but hey ho. If you want to use this plugin you have to make sure you have .NET 3.5 installed. If you don’t you’ll be prompted by the installer anyway.