Monday, December 3, 2012

Building Just To Build

8 days ago I was exhausted from a day of Christmas decorating. We went to cut down the tree, I hung lights outside, took care of decorations inside the house, etc. I ended the night on the couch with a Celebration Ale and watching Nation Lampoon's Christmas Vacation with Julie. It is a tradition in my family to watch this movie on Thanksgiving weekend. It is also a tradition that we endlessly cite lines from the movie. Over time I have noticed that we are not the only ones that do this. It seems to be a popular tradition among those that are near my same age. I thought to myself "It would be cool if someone had a web app that released a quote from the movie each day of December until Christmas. Kind of like an advent calendar for Christmas Vacation quotes." In the past I would have wished someone would take the time to build out something stupid like this. But wait, I just took a three month intensive training course to make web apps. Why not just build it myself? Well, I introduce you to Griswold Advent.

After getting done with work around 10PM on Monday I opened up iTerm, TextMate, and started coding away. After about 3 hours of work I had a functional app that spit out a quote, and limited when quotes would be shown and on what day. In other words, the system would not start showing the first quote until Dec 1, and you could not see future quotes until the day it was supposed to be shown.

On Tuesday I threw in some Twitter Bootstrap to help give me some quick styling to work with as well as a responsive design for anyone looking at the site from a mobile phone. By this time I was probably about 6 hours into things. I pretty much had everything done. Just needed to clean up some things, buy the domain name, and launch. That is until I spoke with my Uncle. He said it was cool and all, but he would never remember to come to the site daily. He doesn't use Twitter. What he needed was a daily SMS.

I took that as a challenge, and Wednesday night I dove into the Twilio API documents. I started playing around with the Twilio ruby gem, and in about 15 mins was able to send a test SMS out. I started coding and had a fully functional SMS system that could: receive a phone number from a user, store it in a database, send a verification text, receive the verification reply, mark the database entry as verified, and also remove an entry if they texted STOP back to our number. The API was pretty easy to use. Twilio performed a workshop at Code Academy (now The Starter League) when I was going there, but I had not attended. I had something else going on that evening, but kind of wish I had now. It would have made this integration go that much quicker. Even though I had it working in a couple hours, I still had some bugs and problems to work through. Most of the bugs were actually stupid mistakes you make from coding on no sleep. I ended up messing around with things from around 10PM until 4AM to get it all working right and bug free. That also included jumping back and forth between other work I am involved in, but I would say at least 4 of the 6 hours was playing around with Twilio.

Twilio isn't free, and I knew if for some reason my stupid app caught on it could end up costing me some money. I didn't mind it, but it would be cool if my time and money went to a good cause. I decided to promote a charity: water campaign as a way people could give back for the daily laughs they receive. I set that up on the main page as well as learned how to create a rake task that can be run by Heroku to send out the daily texts automatically. I set up a scheduled task to send out the daily SMS messages to those that had signed up. I also had to clean up a few issues that were seen in IE 7 and 8. I am not a fan of IE, so I really didn't want to spend a whole lot of time making sure the site looked good in them. I did what I could in a minimal amount of time and got it looking somewhat presentable. I am sure those users are pretty used to seeing sites that look like crap, so I am not too worried.

I sent out a few emails, posted it on Reddit, and set up a Twitter account. I decided that sending daily tweets out myself was too much work. I needed something automated like the rest of the site. I grabbed the twitter gem and created a scheduled task to send out the daily quote through Twitter at the same time the system sent out the daily SMS messages. Everything was done, and seemed to be working on my development setup. Now it was just time to wait and see what happened at 12AM Dec 1 when the site would stop redirecting to a coming soon page and go live automatically with the day 1 quote. Everything worked like a charm. The next test was at 10AM on Dec 1 to see if the SMS and tweet tasks worked OK. Boom, the SMS was received, but the tweet did not go through. I later found out that there was a problem with how I was truncating the quote, and it exceeded the 140 character limit. By day 2 the tweets were going out automatically as well.

So in about 12 hours of actual working time I designed and built a simple web app that few people will ever care about. I know the amount of time I put into this is way too much for what this app does. That is obvious. The thing is that I really do not care. I had an idea of something I wanted to see built, and I did it. There is a sense of pride in this process that outweighs the time I could have been doing more valuable work. I also exposed myself to the Twilio and Twitter API's for the first time. Most of all, I learned from the experience. These little mini personal hackathons have always been valuable for me learning and being able to take that knowledge and apply it to something more important like Reading Glue. Once you learn how to build things, you find that you seek out little projects to create just because you can. It can become addictive, but it also becomes a great way to continue learning. That is why I recommend to anyone that they should build just to build.
Post a Comment