Movie Lookup

See that little picture of the Scarface movie box down at the lower left of your screen? Those things don’t make themselves… Every time I change the current movie, I have to search Netflix for the image and Rotten Tomatoes for the link. But I have this thing, once I do something SO MANY TIMES, I get so fed up with the process that I automate it. That’s what I did tonight for those little movie pictures.

First off, here’s a screenshot of my spiffy new app:

And now how it works… When I click 'Find', the app searches both Netflix and Rotten Tomatoes for the string in the upper TextBox (hellboy in the screenshot) using Google’s web services (Web services are basically classes and functions that are exposed over the web that can be called remotely). The app assumes that the #1 returned item for each site will be the one I want (yes, I’m Feeling Lucky). To grab the image address from the Netflix URL, I make an HttpWebRequest with the address from Google, call GetResponse and search the returned Stream for the image URL. I drop this URL and the Rotten Tomatoes URL into some HTML boilerplate and spit out the final string in the lower TextBox. If ‘Preview’ is clicked, the text in the lower TextBox is dumped into a temp file and the app creates a new IE process with that temp file as its arg.

Now here’s the scary thing… I didn’t know how to do any of this before tonight. .NET makes everything SO easy to do that a novice can make pretty powerful stuff (ok, maybe I’m not a novice, but I’m definitely no .NET expert…)

Now I need to start watching movies like mad so that I can use my happy new program!!

5 Comments

Cool-- I want one. Can you send me the source? I do the same thing for Static Zombie, but I tend to use IMDB instead of Rotten Tomatoes.

Funny, I was going to make an IMDB version last night and email it to you... but then I figured I'd just post my entry and see if you were interested. You can grab the exe and src here.

The readers of my blog would be very interested in such a utility. However, I am ignorant of .Net. I got an error message when I tried to run your program. It said I had caused a security exception. I tried to run this program from inside a corporate WAN. Is that why?

Thanks,
Becky

Yikes, when I wrote this, I didn't intend it to be used by more than just me... Which means I put NO error checking into the program (so if the search field is empty, or the returned netflix page doesn't have a boxshot, or ... you'll get an exception).

Let me fix it up before you share it out (and can you can give me the specific error you're seeing? Does it fail regardless of what you type in the upper field, or was it a specific movie title that it failed with?)

Ok, I put in some error checking (I actually had more in there than I remembered). I also had to change the preview functionality because it stopped working after XP SP2 was installed (I was opening a .tmp file with IE, but apparently now only HTML file extensions are displayed as HTML in IE...) As for the security exception, it sounds like it’s a security policy at your work, I’ve found info on how to change the policy in the Administrator Tools, but it’s probably more hassle than it’s worth (I couldn’t get the exception to happen for me, so I don’t know exactly what would have to be changed). You’re welcome to link to the download if you like (though maybe not if you can’t get it to work for you!!)

Random Photo