The Matrix Reloaded (in Qlik) – Part 2

In the first part of this blog series, we sourced and processed movie scripts for the entire Matrix Trilogy in QlikView.  We then used Qlik Web Connectors and the Aylien Sentiment engine to get Sentiment and Objectivity scores for every passage of the dialogue across the trilogy.  Excellent progress so far, but what’s next?

Download and Install The Qlik REST Connector

So, I suppose that technically speaking, i could have just visited Wikipedia and copy pasted some data from each movie, and whacked that into some text boxes.  But where’s the fun (or challenge) in that?  Instead, I wanted to spend some time getting to know the Qlik REST Connector.

The Qlik REST Connector must be installed separately for QlikView. The installation package can be obtained from Log on with a registered customer or partner account and select Support. On the Qlik Support page, select Customer Downloads and then select the Connector tab.

Alternatively, you can get it from Qlik Market, and I will include it in the download bundle with the app at the end of this series.  The download will be called QlikRESTConnector_x64setup.exe and it’s just a straight install.

Get the Movie and Cast Data from The Movie DB

So, we now need to work out where to source our movie data and what exactly do we need?  In order to keep the project as consumable as possible, i was ideally looking for an API that was free to use and did not require many layers of authentication.

In terms of movie data, what was I looking for?

  1. Basic movie info like Title, Year of Release, Average Rating, Budget, Revenue – those types of things.
  2. Cast details such as Actor, Character Name, and preferably a link to an image.

In the end, I came across a really nice API for this purpose at The Movie DB .  The only prerequisite is that you sign up for an account in order to get an API Key.  Once that’s done, follow these steps:

  1. Click into your account settings (screenshot)
  2. Click the API menu item on the left (screenshot)
  3. Click “Create” from the API page (screenshot)

So, now you should have an API Key and a screen that looks a bit like the below.  Your API Key (It’s the v3 one you need) is important, so keep that on tap.

Now we have an API Key, let’s find some API endpoints to play with.  There’s loads of things you can look up with this API, but I managed to find the Movies -> Get Details and Movies -> Get Credits endpoints as a good base to work from.

You can test these out by going to the API pages linked and using the Try It Out tab.  Then just type in the movie_id of 603 (The Matrix), 604 (Reloaded) or 605 (Revolutions)

Note: I found the id’s for the all 3 movies (603, 604, 605) using the SEARCH -> Search Movies Endpoint and a query of The Matrix

So, we’ve now tested our Movie API endpoints, let’s pull that data using the Qlik REST connector in QlikView.  Oh yeah!!

Get Movie and Cast Data in QlikView

Create a new QlikView app that you’re going to use to extract the Movie and Cast data.  In QlikView, go into Edit Script and in the bottom left hand corner under Database, select the QvRestConnector.exe (64) (Qlik Rest Connector) option.  Hit the Connect button.

Copy the contents from the Send Request URL on the Movie Endpoint page.  It will be of the format :

Paste the URL into the REST Connection settings in the URL box, like below and Test Connection.

Hit OK.  A Custom Connect statement should be generated.  Hit Select.  From the Create Select Statement dialogue, make sure only the cast box is checked (unless you want to pull through all the crew details as well of course, but we don’t cover that here).

The really cool thing here is that the connector creates a sensibly named table and fields for you to start with.  In this case, a table called cast is generated.  Now you have the code, test it and make sure it works!  If it did, you’ll now be able to pull up a glorious table object with the fruits of your labour, like this absolute beauty 😛

And that’s kind of the basics right there.  You can now copy and paste the code you just generated and modify the Connect call to reflect the movie_id you need.  A bit of concatenate loading, and you’ve pulled in the cast for all 3 Matrix movies.  Repeat the process for the Movie details, this time using the Movies -> Get Credits endpoint as your launchpad.

For the finishing touches, save the Cast and Movies details into QVDs for later use – they’re going to be very important for us when building the app detailed in the final post.

Excellent job so far!  Let’s tie up a few more things we need before we can start the app build.  First thing – Fonts – those iconic, beautiful fonts….

Grabbing and Installing the Fonts from The Matrix

Everyone who’s seen The Matrix probably knows there’s 2 iconic fonts from this poster:

Apart from the fact it’s sensational movie art, the 2 things you need to know are the names of the fonts:

  1. OCR A Extended – This is the ‘KEANU REEVES’ and ‘LAURENCE FISHBURNE’ font above.  Think BBC Micro and Dot Matrix printers 🙂
  2. Miltown – I was so excited when i found this font.  The ACTUAL font used for the titles of The Matrix.  So damn cool.

Go ahead and grab ’em from the web just now if you’re too excited – i’ll include them in the download pack for the app.  I get it, i really do!  Just know that Miltown has a few caveats, which i’ll discuss in the final post.  But it’s so much more satisfying to have found and used the fonts rather than have to use screenshots or gifs throughout my app.

Anyways, once you have the fonts, install the hell out of them.  Be like Neo.  Enter The Matrix…of fonts.

Last Prep – Word Cloud Extension

In order to pep up our app with some cool ways to look at this spicy data, i decided to plump for the QlikView Word Cloud extension.  It’s getting on a bit now, but it does the business for what i needed.  Download it and install from the irrepressible and inspiring Brian Munz (Qlik Dev Relations Manager) GitHub repository Then install the wordCloud.qar extension by double clicking after installing.  It’ll then be available to you in QlikView in WebView – we’ll talk more about that in the last installment.

I’m sorry, it’s not over yet….

Final Post – The Coup de Gras

Sounds like something The Merovingian might say 🙂  Maybe he did – we’ll find out soon!  In the final installment of this series, we’ll tie up all of the cool things we have built and extracted and sourced so far and create a killer Matrix app.  You won’t want to miss this one.  I’ll be going through lots  of tips of tricks i used to build the app too.  I’ll leave you, fittingly, with a quote from the Trilogy – see if you can tell me who it is:

‘It’s a single cell protein combined with synthetic aminos, vitamins, and minerals. Everything the body needs.’

Without the app.  No Google.  I’m watching.

Until next time, continue to makeitqlik!



One Comment

Add a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.