Category Archives: Entrepreneurship

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.

President of the United States, Teacher-in-Chief

I’m hopeful about the potential for President Obama to be Teacher-in-Chief.

I did not vote for President Obama. I strongly dislike much of his agenda, including the expansion of abortion rights, the “creation” of jobs by government fiat, and the expansion of government to which he alluded in his Inaugural Address.

However, President Obama’s apparent popularity affords him the opportunity to be “Teacher-in-Chief.” The Presidency of the United States is a great platform from which to teach. I think it’s been squandered by presidents who think that they must do something, when it may be enough to teach something.

If President Obama uses this opportunity–the popularity he’s built–to teach correct principles, he’ll do far more good than could be done through any new government program. As long as he has listening supporters, he should teach economics, personal finance, debt-avoidance, self-reliance, service, industry, and more.

For example, I liked this from his Inaugural Address:

Our journey has never been one of short-cuts or settling for less. It has not been the path for the faint-hearted, for those that prefer leisure over work, or seek only the pleasures of riches and fame. Rather, it has been the risk-takers, the doers, the makers of things — some celebrated, but more often men and women obscure in their labor — who have carried us up the long rugged path towards prosperity and freedom.

Not this:

The question we ask today is not whether our government is too big or too small, but whether it works — whether it helps families find jobs at a decent wage, care they can afford, a retirement that is dignified. Where the answer is yes, we intend to move forward.

We don’t need a president who pretends he can give us what we need. We need a president who will inspire us to work for those things ourselves. I believe this may be within President Obama’s power. Don’t waste it, Mr. President.

(For an interesting read, see Chris Knudsen’s thoughts on President Obama.)

Markets are like parking lots

Markets are like parking lots.

To get a spot:

  • Get there early, or
  • Park where there’s less competition (but you’ll have to walk more), or
  • Find a proprietary advantage that sets you apart and locks out your competitors

Parking is good when you’ve got two wheels — motorcycle or scooter. Imagine my excitement in finding a shady spot near the door which had been “reserved” by a car that parked over the line, blocking out all my four-wheeled competitors. I left for lunch and came back to a full lot, but my spot was still saved. That’s good business.


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.