Categories
Business Entrepreneurship Main Programming Tech

Reminiscing about Provo411.com and Scraping the Course Catalog

One of my first web development projects and biz partnerships with Brian Stucki was Provo411.com. 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 byucougars.com 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 Provo411.com 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 "https://bighorn.nevada.edu/sis_csn/XSMBWEBM/SIVRE04.STR"`
    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!"}
        else
            puts "#{$1.strip}\n"
        end
    else
        puts "could not find message"
        say "Help. I cannot access the C S N website."
        return
    end
    sleep 5
end

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

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.

Categories
Apple Getting Things Done How To Mac Main Tech Tips

iPhone tip: Use a Silent Ringtone to Screen Calls in Your Sleep

Have you ever wished your iPhone would ring only when certain people call? Here’s how to do it:

  1. Download the “Silence” ringtone here: silence.m4r
  2. Copy this file into the Ringtones section of your iTunes. (Click to enlarge.)

    adding_ringtone_to_itunes
  3. Sync your iPhone with iTunes to load the ringtone.
  4. On your iPhone, change your ringtone to “Silence” (under Settings -> Sounds -> Ringtone). You’ll no longer hear your phone calls.

    2_iphone_silence_ringtone
  5. For each person whose calls you still want to hear, change his or her Custom Ringtone to something audible: Click the name in your contact list, choose Ringtone, then choose something besides Default

    3_iphone_important_caller 4_iphone_audible_ringtone

Now you can screen calls in your sleep. Because Sunday afternoons are for napping.

Categories
Apple Getting Things Done Mac Main Tech Tips

3 Uses for iPhone Screenshots

For all the iPhone users out there: You probably know you can take a snapshot of whatever you see on your screen:

  1. Briefly press the top and front buttons at the same time.
  2. The screen will flash white and you’ll hear a “snapshot” sound.
  3. A picture of your screen is now in your iPhone “Photos”.

I’ve found it extremely helpful to make screenshots, and I do it all the time. Here are a few reasons:

Remember an Interesting Part of a Podcast

If I’m driving and hear something I like in a podcast, I make a quick screenshot of the playback screen. When I get back to my computer, I can return to that spot in the podcast and take notes.

iphone_screenshot_podcast

Save a Point on a Map

Sometimes I want to “bookmark” a location on the map before looking up something else. A screenshot is a fast way to do this.

iphone_screenshot_map

Save a Website Address Without Interrupting Your Reading

Sometimes when I’m reading in Google Reader, I want to save the location of an article to read later. (I don’t want to leave Google Reader immediately because it has to entirely reload when I return.)

If you hold your finger on a link for a few seconds, a menu will popup with the address of the link. Sometimes I simply save a screenshot of the link, then hit Cancel and go back to my reading. Later I read the items I saved in my screenshots.

iphone_screenshot_opened_link

Screenshots can help you practice “ubiquitous capture” — capturing all notes, thoughts, and ideas, as they come to you, so you don’t have to keep them in your head.

Categories
How To Main Tech Tips

How to Save Voicemail Forever on Your Mac

With a combo of free Mac applications, you can record and save voicemails from your mobile phone.

You’ll need to install the following Mac applications:

skype Skype. You’ll use Skype to make a call to your mobile phone and listen to your voicemail. Though the app is free, you’ll need to buy Skype Credit to make a “Skype Out” call to your mobile phone.

 

audacity Audacity. You’ll use this free application to record your phone call.

 

soundflowerbed Soundflower and Soundflowerbed. This free system extension will connect Skype to Audacity. It’s like a laundry chute for audio; you can direct audio from any application to another. It does this by adding a pseudo “device” to your list of audio devices in System Preferences.

Instructions:

  1. Open Audacity, then Audacity Preferences. In the Audio I/O section, change the Recording device to Core Audio: Soundflower (2ch). audacity_preferences
  2. Open Skype, then Skype Preferences. Under the Audio tab, change Audio Output to Soundflower (2ch).
    skype_preferences
  3. Open Soundflowerbed in your menu bar, then under Soundflower (2ch), select Built-in Output. Soundflowerbed allows you to monitor the audio passing through Soundflower, like having a window into the laundry shoot to watch clothes that fall past.
    soundflower_preferences
  4. Back in Audacity, click the Record button to begin recording.

    audacity_record_button

  5. In Skype, make a call to your cell phone. When your greeting begins playing, press the sequence of keys that accesses your voicemail (probably the asterisk key followed by your password.) Listen to your voicemail as you normally would. Then hang up. skype_phonecall
  6. Switch back to Audacity and click the Stop button. You should see the zig-zaggy waveform of the message you just recorded.
    audacity_stop_button
    audacity_waveform
  7. Click the Audacity cursor directly before your message. (You can find out where this is by using the Play and Stop buttons.) From the Edit menu, choose Select then Track Start to Cursor. Push the Delete key on your keyboard. This will remove extraneous audio before your message. audacity_before
  8. Click the Audacity cursor directly after your message. From the Edit menu, choose Select then Cursor to Track End. Push the Delete key. This will remove extraneous audio after your message. audacity_after
  9. Choose Export from the File menu and save your voicemail. You can email it to a friend or save it in iTunes. audacity_export
Categories
Mac Main Security Tech Unix

How to browse securely with SSH and a SOCKS proxy

I was in Moab this weekend with my family and our motel had free wireless Internet. I used SSH and a SOCKS proxy to create a secure tunnel to my iMac at work. This allowed me to browse Gmail and Facebook securely.

Here’s a screencast on how to create an SSH tunnel and browse securely in Safari and Firefox:

Here’s a full-size video:
How to browse securely with SSH and a SOCKS proxy (full size video)

These are the basic steps on a Mac:
1. Open Terminal. (In your Applications/Utilities folder.)
2. Type “ssh -D 9999 username@example.com”, replacing “username” and “example.com” with the actual username and address of your remote machine. The remote machine will need the SSH service, or Remote Login service, turned on.
3. Open System Preferences -> Network -> Advanced tab -> Proxies.
4. Turn on the “SOCKS Proxy” and enter “127.0.0.1” and “9999” in the fields. Click OK and Apply.

Now your Internet connection will be tunneled through a secure connection to your remote machine — a poor man’s VPN.