Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a list of movies in a text file. I would like some way to automatically obtain the IMDB movie hyperlinks for each item in my list. Is this possible?

share|improve this question

Although this isn't a direct link to the IMDB for the movie, it will probably work in most cases. Just use Google's I'm Feeling Lucky feature. Of course you will need to URL encode the movie title, but something like this should work:

http://www.google.com/search?q=imdb+%22Movie+Title%22&btnI=I%27m+Feeling+Lucky

Replacing Movie+Title with each URL encoded title of course.

Here is an Excel VBA macro you can use to do URL encoding(courtesy of Motobit):

Function URLEncode(ByVal Data, CharSet)
  'Create a ByteArray object
  Dim ByteArray: Set ByteArray = CreateObject("ScriptUtils.ByteArray")
  If Len(CharSet)>0 Then ByteArray.CharSet = CharSet

  ByteArray.String = Data

  If ByteArray.Length > 0 Then
    Dim I, C, Out

    For I = 1 To ByteArray.Length
      'For each byte of the encoded data
      C = ByteArray(I)
      If C = 32 Then 'convert space to +
        Out = Out + "+"
      ElseIf (C < 48 Or c>126) Or (c>56 And c<=64) Then
        Out = Out + "%" + Hex(C)
      Else
        Out = Out + Chr(c)
      End If
    Next
    URLEncode = Out
  End If
End Function
share|improve this answer

Check out some of the samples provided by Dean Clatworthy.

share|improve this answer
    
Although, I suggest you hurry because March 1st is your deadline before IMDB's new ToS kick in. – Scott Feb 17 '10 at 21:37

You must log in to answer this question.