Current DVD Releases via Rotten Tomatoes API
How do you know what movies have recently been released on DVD? I assume that there are multiple sources for this information like Amazon, iTunes, or IMDB but today I have found that Rotten Tomates provides this data via their API. They also have methods to retrieve movies currently in theaters, upcoming films, movie lists and specific movie information like trailers and clips. The API is really straightforward and we can quickly leverage it to make our own page of current DVD releases.
It took me less than a minute to sign up at Rotten Tomatoes for their API. After that I took a look at their JSON response for Current Release DVDs.
In their JSON response, I noticed that they provide an IMDB id from which you can easily generate a link to the specific movie on IMDB. This is great because IMDB does not have an API that I can use but at least we have a link.
So, I added jQuery to my demo and setup an Ajax call to retrieve the last 50 currently released DVDs from Rotten Tomatoes after the DOM is ready. The searchCallback function then parses the JSON response and wraps text and links around HTML tags which have some CSS defined to create a list of movie posters. When you click on a movie poster, an overlay pops up with more information from the initial JSON response, plus at that point loadclips function fires and makes another API call to grab the clips and trailers for the selected movie. Pretty simple, so, what’s next? Well, you could make tabs and provide all the methods available or add some love to the simple design.
Check out the demo and look at the source code to see how it all works.