Global Constant
Steve Nay's ramblings

Simple stats for Kynetx apps

TomatoFlix has become rather popular lately. It runs on several different sites: Netflix (hence the name), IMDb, Redbox, Movies.com, and Fandango. I want some more detailed information about where people use it the most.

I decided to use app variables as simple counters. The idea for this came from a similar thing that Ed Orcutt did with HoverMe.

At the end of each rule, I added a postlude that increments an app variable identifying the website where it was run. The rule for Netflix now looks like this at the end:

Simple enough. Every time the rule gets fired on Netflix, that counter gets incremented.

Now to build a front-end for viewing the stats. I’m not too picky about this, since no one will look at them besides me. I use Randall Bohn’s ktest Heroku app as the endpoint. Then I just build a simple notify() like this:

Now I just have to add a bookmark to my toolbar that goes to my app’s url on ktest.heroku.com and we’re set. (Sam Curren’s Kynetx AppBuilder kTest Link app makes that really easy to find.) Here’s what it looks like:

And since ktest runs the dev version of the app as if it were a bookmarklet, I don’t have to add ktest.heroku.com to the dispatch block (which might confuse users downloading the app).