MovieBox demo app on GitHub


Just a quick note, I have a project up on GitHub called MovieBox. This was based on keyStream by Cory Fail, but is built on top of the ColdBox framework. Right now it is in a holding pattern because I am going to rewrite it using AngularJS for the frontend and Taffy for the backend REST API. I have been wanting a good learning project for Angular, bower, gulpjs, et al so this will be my guinea pig..

This project does have some pretty good bits, it can scan a directory of movies and pull the metadata from themoviedb.org and update your library accordingly. You will need to specify the default location of your movie directory which is set in /config/Coldbox.cfc under custom settings. Currently the indexer does not run automatically, it must be forced by calling http://localhost/wtf/indexMovies. There is a SQL script for the database creation (mySQL format, but may work on others) to setup the database schema. It expects a data source named moviebox to be setup in the web/server administrator. Additionally, it is assumes the movies are stored as X:/movies/moviename or even better X:/movies/moviename (year).

All videos should be available to the web server under the /media directory. Assuming you are using Nginx as the front end proxy it is an easy as creating an alias in your site definition, but it should be easy enough to do in other servers.

If your server does not support SES URLs you must edit the /config/Routes.cfm and add “index.cfm” to the setBaseURL() line. Also, I would definitely recommend using the development branch as it is the most updated (and also contains the SQL script for database generation).

Aside from that, everything should work great. :)  The indexer will attempt to download the movie poster and backdrop and will copy the data into the movie folder as well as the data folder under the web root. If the data folder does not exist it will be created for you. If you have a lot of data, expect the initial look up to take a while. Subsequent scans will ignore titles that are already known.

You can check it out here: https://github.com/robertz/moviebox/tree/development

CommandBox is not just for ColdBox


A few weeks ago I think it was Ray who had posted something about CommandBox. I had heard about it before its release, but I totally missed it when it was unveiled at Into the Box.

I have to say it has quite a few features that I really love. Being able to completely setup a ColdBox application scaffold with just one command is great. The package management system is another awesome feature in and of itself; one that other languages have had a leg up on ColdFusion for a very long time.

One feature that might be easily overlooked (I certainly did) is the embedded server. I did play around with it initially then I promptly forgot all about it. Which brings me to today when I wanted to check out a project from github (Taffy, but that is another post), I wasn’t anywhere near my home machine and I really didn’t want to install Railo Express just to test something out. Turns out it wasn’t an issue, I just extracted all the files out to a directory, fired up CommandBox, typed “server start” and fired up a Railo server I could play around with without any additional configuration needed.

Incidentally, you can access the web/server administrator and it will retain your configuration data for that folder so your settings will persist which also is really awesome.

If you haven’t looked into CommandBox because you don’t use ColdBox it might be worth a look. I look forward to seeing where this project goes in the future. You can see the intro video here: http://www.ortussolutions.com/products/commandbox

Sublime Text not refreshing the sidebar


As much as I love Sublime Text one issue that has really buggered me is that occasionally when deleting a file the sidebar will not update. Also, when creating a new file it won’t necessarily show up in the sidebar either. Admittedly, my project structure is pretty wild and spans about six mapped drives, but it is annoying none the less.

Today I finally snapped and did some google-fu and found a solution. It looks like it annoyed someone else and they wrote a plugin to fill that gap call syncedSideBar. You can easily install through package manager or find it here: https://github.com/sobstel/SyncedSideBar

I am posting this here as a reminder to myself but I thought someone else may find it helpful. A big hat tip to the author.

themoviedb.org API and ColdFusion


Last week while hanging out in the #coldfusion IRC channel I came across a nifty new app called keyStream created by Cory Fail. In a nutshell, it is a ColdFusion application that allows you to stream your media to your devices while you are attached to your home network. This appeals to my tender sensibilities since I tend to watch movies online more than on a TV.

KeyStream is a great application, one thing that was missing for me was being able to hit an API to pull down movie metadata. If you have a lot of media files it is nice to have an automated way of scanning through a whole directory of files in one fell swoop ala XBMC or comparable media applications. With that in mind, I set to see how difficult it would be to interface with tmdb.org in ColdFusion and I found that it actually was not that difficult.

Here is the TMDBService object for ColdBox although it could easily be ported:

First step though is getting an API key. Cruise over to themoviedb.org and sign up for an API key. It is free so even us starving developers can afford it.

Doing a lookup basically requires two steps. First we will pass the movie name in as a string to the findMovie(name, year) function which goes to the APIs /search/movie endpoint. This will return a list of matches back from tmdb.org, if there is an exact match it will be pushed up to the top of the list. Assuming the first position is the movie we want it is time to go to the APIs /movie/{id} endpoint(getMovieData(id) function in the gist if you are following along), passing it the id we got in the first call. This is where we get all the fun stuff such as the poster and backdrop data, overview, release date and IMDB rating. If you would want to see it when viewing your media, this is where you would find it.

To speed the process up a little bit I created the scrape() method that fires these two calls in one swoop. It assumes it will always have an exact match in the movie title, things get a little hairy when there isn’t an exact match but this is still a work in progress.

 

The final step is to call the APIs /configuration endpoint if you are wanting to download the cover and background art. This data tells you where to look on their image server for the images since they are sorted out by size and then it is just a matter of making a cfhttp call out and downloading the images to your local server. Assuming there is enough interest I could provide a more detailed accounting of getting this done. The finished product could look something like this:

2013 in review


The WordPress.com stats helper monkeys prepared a 2013 annual report for this blog.

Here’s an excerpt:

The concert hall at the Sydney Opera House holds 2,700 people. This blog was viewed about 51,000 times in 2013. If it were a concert at Sydney Opera House, it would take about 19 sold-out performances for that many people to see it.

Click here to see the complete report.

Nginx/Railo connector for SSL-enabled sites


I was asked if I could provide my Nginx configuration for SSL-enabled sites yesterday so I thought I would write up a quick post. This is very similar to creating a standard site container with the addition of another server block that will be listening on port 443. Also, any traffic that comes in on port 80 will automatically be redirected over to the secure site. Nginx will handle the secure portion of the connection so there are no settings to modify on Tomcat. It should “Just Work” ™.

I will be referencing the additional configuration files that are outlined in My Final Nginx/Railo Connector post. Below is the template I use for SSL-enabled sites:

The important differences here are the ssl keys: ssl, ssl_certificate and finally ssl_certificate_key. Now I need to generate the certificate and certificate key that I am going to use. For clarity, here is the excellent post explaining how to generate the SSL keys. Although this is outlined on older versions of Ubuntu it should still work just fine.

Once the new keys have been generated and put in the proper place (/etc/ssl/certs and /etc/ssl/private) it is only a matter of restarting Nginx and enjoying the SSL goodness.

Chat demo ColdBox application pushed to GitHub


Back in June I ported a simple chat application so that it would work with the Coldbox framework. Brad Wood suggested making the entire application freely available on GitHub instead of posting the individual components as Gists. Well, I finally got around to doing that and you may find my entire demo site here:

http://github.com/robertz/Demos

As long as your server supports SES URLs you should be in business. I do use submodules with my git projects so you will have to ensure that the coldbox-platform submodule is initialized.

I also have been playing around with Vagrant so I can easily spin up a virtual machine that matches my production environment. I have a box setup with Railo using Nginx as a proxy that I am currently using for development and if anyone is interested I may make that available for download. It is great to start working on a new project and just typing “vagrant up” to spin up the dev server without having to worry about doing a server config. Vagrant is just awesome.

Coldbox files for chat demo


I was asked if I could provide the files for the latest chat demo I came up with that was rewritten in Coldbox. I do not have this zipped up as a package, but here are the core files.

Enjoy!

ChatService.cfc

endpointChat.cfc (API endpoint handler)

chatdemo.js

Simple CF Chat updated to work with ColdBox


Over the long weekend I had a chance to really dig in to ColdBox. We use ColdBox pretty exclusively at work and digging into the framework and getting to the nuts and bolts of things just made sense. My first “hello world” application was porting my old CFChat application over to ColdBox and get it up and running using routes, services and handlers.

The code was pretty ugly when I first posted it up. I went ahead and rewrote the whole thing from the ground up and fixed some of the glaring issues that bothered me since I first “released” it. I also threw out the old javascript file and rewrote that from scratch. 

This was pretty much a dead end project as I could probably implement something much better as a web service, but it did introduce me to a lot of core concepts in ColdBox and that is what it was all about anyway, really.

If you are interested in checking out the shiny new stuff you can check it out here: http://demos.kisdigital.com/demos/chat.

So Long and Thanks for All the Fish


Well, today I stepped down as the Lead Front End Ordering Engineer at Market America. Since I started in January 2010 I have had the chance to meet and work with a bunch of amazing people. I managed to learn many things during my time there, but all good things must come to an end. It was not an easy decision to make but it was time to pass the torch and move on.

I will miss the family I have made there; none more than the other members of the Ordering team I have spent years in the trenches with.  I love all you guys and wish you all the best!

Follow

Get every new post delivered to your Inbox.

Join 831 other followers