Category Archives: Programming + Kynetx: How websites could be better with your family

I’ve been playing around with technology. I think it has a lot of cool potential for helping users see who their relatives are across multiple websites.

For example,

  • What if you could see your relatives directly in Facebook?
  • If you knew which LinkedIn users were your relatives, would you be more likely to do business?
  • If you knew which Twitter users were your relatives, would you be more likely to follow them?
  • If you discovered that a comment on a political news story with which you strongly disagreed was from a relative, would you be more careful how you responded?

Here’s a demo video:

Reminiscing about and Scraping the Course Catalog

One of my first web development projects and biz partnerships with Brian Stucki was We were roommates at BYU and conceived of a website where students could share events — parties, concerts, football games, etc. We were already in our beds for the night when the idea came, but we couldn’t go to sleep before buying the domain. I think it was the first domain I ever bought. It was September 2002.

I developed a calendar in PHP and wrote a few scripts to scrape and retrieve the sports schedules. I also developed a WML app so Brian and I could add events to the calendar from our pre-iPhone mobile phones. I recall being at a party in south Provo, in a former dental office, and using my Nextel phone to add the party to Provo411. If you go back far enough, you can see events on the calendar. My brother Alan did the artwork.

I always wanted to have a course schedule alert system. Perhaps students would pay $3 to receive an email or SMS alert when hard-to-get classes had an opening. It shouldn’t have been hard technically, but the publicly available course catalog isn’t updated in real-time. I could have scraped the authenticated course catalog on Route Y, but BYU might have objected and it’d be a fragile business model.

My brother Michael recently came home from his mission and started school at CSN. The business classes he wanted were full, so I put the old “course schedule alert” idea to the test with some new tools — Ruby and Mac OS X’s speech. Here’s what I came up with:

#!/usr/bin/env ruby

# a list of course call numbers to check
call_numbers = %w{ 46405 46407 46409 46411 46415 46413 53252 53254 53256 53258 53260 53262 53268 53270 53272 53274 46423 46435 53276 46443 }

# auth_token obtained via Firefox+TamperData while my brother logged into CSN
auth_token = "123456789012345"

say "Checking"

call_numbers.uniq.sort.each do |call_number|
    c = `curl -si -d CONVTOKEN=#{auth_token} -d AUDITT=N -d CALLT=#{call_number} -d CONTINUE=Continue ""`
    print "Call number #{call_number}: "
    if (c =~ /<p class="p5">([^< &#93;+)<br\/>/m)
        if $1.strip.empty?
            puts "May have openings\n"
            3.times {say "Michael, class number #{call_number} may be open!"}
            puts "#{$1.strip}\n"
        puts "could not find message"
        say "Help. I cannot access the C S N website."
    sleep 5

# Ouput an audible message via Mac OS X's speech function
def say(message)
    `say "#{message}"`

We set this to run every 15 minutes on the living room iMac, and we turned up the volume. Every 15 minutes we could hear “Checking” from the computer. A few hours later we heard the script announce that a class had opened up. Michael, I’m still waiting for my $3.

More Flow, More Happiness

I usually spend only 20% of my workday programming, but this week I’ve been doing more of it and it’s been awesome. There’s something really rewarding about refactoring code — making it more concise, more logical, more consistent. More beautiful. This isn’t even new code; I’m just pruning the old stuff in preparation for coming additions. Jon Udell says good programming is like good writing: you need multiple drafts.

For me, programming is the way I get into flow. Sometimes writing can do it for me too. For my grandmother, I think it was quilting. I believe much happiness comes from creating something.

Notes on Facebook

Amtrak series: Ruby on Rails on Rails

This will be the most technical of my posts in the Amtrak series, but it’s not just for computer geeks so stay with me. Here we go.

Ruby on Rails is a “web application framework”, a way for programmers to make web applications more easily and more quickly (and more enjoyably, as its creators would be quick to point out.) It was created by 37signals, the makers of Basecamp and other fine web apps, and has been one of the fastest growing programming environments of the last couple years. “Ruby” is the programming language and “Rails” is the set of additions that make it “fast” and “easy,” like a high-speed train. (Not a sight-seeing Amtrak.)


You probably see where this is going. As an exercise in literalness, I though it would be interesting to do a little Ruby on Rails programming while on the train, or in other words, Ruby on Rails on Rails. (Mitch Hedberg said “I’d like to see a forklift lift a crate of forks. It’d be so…literal. ‘Hey, you’re using that machine for its exact purpose!'”) See the pictures.

I have not delved into Rails as much as my local colleagues, but with the little I’ve used it, I’ve been impressed. By taking away the tedious parts of programming, it really does make programming more enjoyable. I know several good developers who prefer it.

Ruby on Rails enforces an architecture called “Model-View-Controller” (MVC), which is used heavily in Mac applications and well written web applications. Though not built on Rails, WordPress also uses an MVC architecture. If you have a WordPress blog, you know you can easily change the theme of your blog. This is thanks to the modular MVC architecture with which it was written.


Here’s where this applies to everyone: 37signals hasn’t only extracted Rails from their best programming practices, they’ve also extracted a book from their best business practices. I highly recommend Getting Real by 37signals, availably entirely for free on their website. They’ve given away their “cookbook” — what they’ve learned about marketing, project management, time management, hiring, agility, task prioritization, and more. I finished the book believing that small teams can do great things.