Mobile Site 4.0 … Coming Soon

A new mobile site rewrite for Category5 Technology TV will soon be gracing your smartphone and tablet!

I received a note from one of our viewers who recently found us on Roku, but wanted to take Category5 on the go with him…

Well, that’s kind of annoying for BlackBerry users, isn’t it?

I had a good close look at the mobile site back-end, and man-oh-man, it’s getting old.

I think as a developer, it’s hard not to want to go back and rewrite everything you’ve created about once per year. That’s how fast the technologies change it seems, and the way I was coding a year ago is much different from the way I code now.

The current (old) mobile site uses flat-file delivery powered by a database backend. Your mobile device must preload all textual resources, and then it loads the images and videos when you navigate around. But the architecture forced me to hold back some features at the time.

The episode list on our mobile site version 3.1.

The episode list on our mobile site version 3.1 contains the most recent 53 episodes.

For example, the mobile site (versions 1-3) have always been restricted to the past year’s worth of videos. That’s all that was practical since your device would have to preload all the text for each episode.  Loading all 7 seasons was not possible because it would just take way too long to load, and it’s already much too slow for my liking.

I also had to restrict the amount of images and overall weight of the mobile site since many assets were preloaded at launch. Preloading 53 videos is horrible for performance, and this is not a well optimized way to do things.

So, all that said, Tony’s message and my review of the code drove me to want to redesign the mobile site infrastructure and front-end from the ground up.

There are a few things that come into play, but the big one is that I recently developed the entire infrastructure to bring Category5 to the Roku platform. So I am able to tap into new, optimized database functions that didn’t exist even 3 months ago. Features such as separation of episodes by season, and having access to our entire library of videos, including our “Special Features” category which was introduced specifically for Roku, but now can be migrated to other platforms such as our mobile site.

Out the gate though, a rewrite means implementing greatly improved programming techniques such as AJAX data loading on the mobile platform… so I can rewrite the code so each episode’s text only loads after you click on it. I’ll also stop all these videos from preloading. All this means is that we can offer a million videos if we want, and the site will still load just as quickly as if there were only 5 videos. The ability to load data through AJAX has existed for a long time, but my skill-set has grown with regards to its implementation, so I am now capable of much more than I was a year ago.

The greatly improved episode list on version 4β of our mobile site.

The greatly improved episode list on version 4β of our mobile site features all available episodes (345 at the time of writing).

The biggest and most exciting thing to me about this change in programming style is that I can include all episodes in the mobile site.  Not just the past year’s worth. It also opens us up to eventually including other features, such as the aforementioned “Special Features”.

Do more with less. That’s what version 4 represents.

So keep your eyes on our mobile site. I’ll announce it when it’s launched, and hopefully it’ll even work on BlackBerry.  🙂

-Robbie

Walk-in Wifi Responder

Had a thought this morning that wifi could be used to do some pretty rad stuff… like detecting when I get home by noticing my iPod touch.

Since most of us carry wifi-enabled devices with us at all times, and most of us have them set to auto-connect once in range of our routers, I thought, why not use that data?  It could be as simple as logging coming and going, or as sophisticated as automatically turning on my favorite music when I walk in the door.  Or even adjusting the thermostat when I arrive home to save energy when nobody is around.

As a very brief proof of concept I whipped out a simple algorithm in PHP which can be run from any Linux computer on your network.

Usage:  php wifi-check.php –device=devicename

 0) {
      $tmp=@explode('=', $ping);
      $result=@explode('/', trim($tmp[1]));
    }
    if (count($result) > 0) {
      // Now we know the device is connected; do something
      echo 'Device active.' . PHP_EOL;
    } else {
      // Device is not connected.
      echo 'Device inactive.' . PHP_EOL;
    }
  } else {
    echo 'Usage: php wifi-check.php --device=devicename' . PHP_EOL;
  }
} else {
  echo 'This script is designed to be run from the Linux terminal, not a browser.';
}
?>

My thinking is to put something like this in a looping script and let it run every so many seconds or something, calling particular functions if the device is detected as active vs inactive.

I’d welcome your thoughts in the comment section below.  What practical things could this be used for?