Sep 20 2009

Adventures in FBJS

Another full day at ENTS developing Project Chronos, today I tackled the reminder creation UI. The facebooker gem has a handy helper class for generating forms in an FBML kind of way, this simplified the getting started a great deal. However once you move past the basic html input types it is no longer useful. My attempt to add a simple javascript calendar is where my troubles began.

The most important design aspect of my reminder app is the simplicity and ease of creating reminders. That in mind the default option of 3 select boxes to choose a date is not a viable option. Javascript calendars are normally a dime a dozen on the web and I figured it’d be no problem to add one in. That is when FBJS punched me in the face.

While I absolutely admire FBJS from the standpoint of a technical accomplishment on Facebook’s part, it is a pain in the ass if you want to reuse any libraries (and who doesn’t?). Facebooker has ported a lot of prototype to FBJS, which means a lot of normal rails helpers work. For the life of me though I couldn’t find any drop in calendars that were compatible or easily ported. What I did find on a Facebook developer forum was a kind of hacky solution that I could start working on (oh so greatful to whoever s10sys is at this point).

About this time Rob Davy invaded ENTS and I spent quite a bit of time over the remainder of the night chatting with him.

What work I did get done was my first attempt at hacking into Rails at a frameworky level. It is entirely possible that such was not the appropriate spot for my solution, but it was effective. I added a custom helper in the Facebooker form builder class to generate calendar fields with the appropriate bits of fbjs attached, and by 10pm when I left I actually have a functioning calendar control.

Next on my list is a time picker control. Since there are less graphical bits required and I’ve discovered how poorly most existing libraries play with fbjs I think I will just roll my own based on another solution I’ve seen and been intrigued by. It uses a simple 2 click interface to select any time.

If anyone knows of any wonderful fbjs libraries that my googling failed to find, please drop me a comment. Assuming they don’t exist, this seems like a huge gap waiting to be filled.


Sep 19 2009

Development Environment Setup Complete

I spent all day at ENTS getting started on my new hobby project to build a facebook app. I work in Ruby at Nexopia so it seemed an obvious language choice. I have only dabbled in rails (we wrote our own web framework at nex), but I know enough to get started, so the big thing to figure out was Facebook development.

I started with some extensive googling, with limited success. It seems there historically were two main Facebook gems for rails, RFacebook, and Facebooker. Facebooker as best I could determine seems to have taken over entirely, but its tutorial information seems largely broken and out of date (where it even exists). The API docs seem okay so far, but I really wanted some higher level getting started information. PeepCode to the rescue. They have a pdf and screencast available for $9 that provided an excellent starting point.

With that information I quickly got my app setup on both Facebook, and a basic set of scaffolding in rails, then reached my next hurdle. Since I needed Facebook to talk to my app to test anything, I needed a public IP for my development code. There are several options to achieve this, and I tried most of them before finally settling. Developing directly off of my VPS was an option, particularly by using sshfs to mount the project files. The problem there is largely performance. Textmate in particular makes the assumption that you have faster file system access than is provided by sshfs. Opening up a local port could have worked as well, but I deal with enough different firewalls moving around that it just isn’t really an option for me. That left ssh tunnelling, which I finally settled on. It’s a bit awkward but it allows instant testing of changes, through Facebook, as you make them. I setup a local mysql server (since Facebook uses 64-bit UIDs Rails requires a special plugin for this, scaring me away from multiple database types), and forwarded port 3000 (the default rails test server port) to my remote server, configuring my Facebook app to look on the non-standard port. Tested a basic rails scaffolding through Facebook and rejoiced happily upon seeing all the default forms working in Facebook blue.

I had hoped to get a bit further in actual development today, but given the awkwardness of getting started with Facebook and Rails I’m happy to be as far along as I am. It was fun hanging out at the ENTS space, met a couple people as they popped in throughout the day. Looking forward to going back tomorrow to start work on implementing a UI.


Sep 18 2009

Honey Brown

I went to Pub 1905 tonight after work to return GoW2 to Colin, and to have a couple beers. Ran into David there as well. Amidst yet another debate on religion, I decided to be antisocial and broke out my laptop. I have been wanting to make the switch from slicehost to rackspace cloud for awhile now and the dawn of a new project seems a reasonable time to make the switch. I setup a new server on rackspace and named it honeybrown in honor of my surroundings.

A couple of beers and a burger later I found myself at ENTS configuring the new server. I’ve been doing some reading lately and for my purposes Phusion Passenger and Ruby Enterprise Edition seem an excellent way to reduce my memory footprint (always the sticking point for me with a 256MB VPS). I managed to get both configured with very few obstacles, many points to the Phusion guys for providing amazing installers. I updated my rails versions, setup a git repository through Project Locker, and generated a basic rails app. Project Chronos now officially exists, albeit as just the default rails stub.

Tomorrow I hope to dig into actually getting some development done.


Sep 17 2009

ENTS Grand Opening!

Went to the ENTS grand opening tonight. Was good to see so many people in the space. We got the blade server donated by Nexopia hauled up the stairs, performed a ceremonial ribbon cutting on the Microsoft surface, and enjoyed hot dogs provided by our friendly landlord. Whenever there is a good turn out for an ENTS event it always reenergizes me towards the society. I look forward to spending some time there this weekend working on Project Chronos.

I’ll add some links here to more detailed/picture filled write ups of the evening when I find them.

Updated: Mastermaq’s ENTS writeup http://blog.mastermaq.ca/2009/09/17/ents-grand-opening/

Updated: More photos of the evening via Bill Burris http://www.flickr.com/photos/billburris/sets/72157621638929430/


Sep 14 2009

Project Chronos

So with my lady friend Stephanie out of town for two months doing an artists residency in Banff, I have been left with enough time on my hands to dabble with a side project. I’ve been wanting to try to make a Facebook app for awhile now due to my coworker Andrew’s great success with them. I got ahold of a key to ENTS today, and finally have a free night, so I popped into the space to try and get a start on something.

One thing that is difficult for me developing for Facebook is that I don’t really like Facebook. The simplest way to develop a site is to develop it for yourself, and there just aren’t many Facebook apps out there I would ever use. I considered doing another “Which is cuter?” style site, would be simple to make and they always seem to be popular, but I was having a hard time getting excited about it. After some random web surfing I was pondering the things I needed to remember to do this week and then the light bulb appeared.

I realized it would sure be nice if I could get a reminder message sent to me when I needed it. There are a few web services out there that do this, but I haven’t been able to find a good Facebook app that does. With Facebook’s status as a daily app for most people, and its built-in integration with email, etc. it seems like an excellent medium for the service. The idea lacks an obvious viral growth model, but it has the benefit that it’s something I would actually use. Even if it never becomes popular, it will make my life a small amount better, and it will be an excellent way to get my feet wet with Facebook development. For the time being I dub this Project Chronos, let it begin!