Jan
2009
6:54 PM | Comments (0)
Deliveries ($1.99): You know when you order something, you want it now. At least I do. I stalk the UPS/FedEx/DHL tracking pages constantly, and this makes it ten times more easier and convenient. I also use it to track things I've shipped to other people to make sure they get there alright. You can track packages from all sorts of places. The ones above happen to all be from UPS, hence the brown color scheme.
eBay (FREE): eBay gets a bad rap nowadays, but I still love it. I get things for cheap, and sell things for more than I could anywhere else. Anyway, this app allows me, at a glance, to check auctions I'm selling, watching, and bidding on. You can even bid from the app and search listings. I used to have to find a computer to bid on an auction I knew was ending at a certain time, now I can do it from anywhere.
Summizer ($2.99): Twitter trends come to your iPhone. Trends are a great way to see what's in the news. Summizer not only shows you the current topics that are trending, but you can search Twitter as well, and save certain searches. It lets me know whenever someone mentions "Virginia Tech," "Blacksburg," and others I have set.
Twitterrific (FREE): My Twitter client of choice on the Mac and the iPhone. There are many others out there that people seem to prefer, but 2.0 is coming out soon for the iPhone and it sounds awesome. I like how you can easily reply to tweets and DMs, and TwitPic and web browser integration is very convenient. Plus it can load up to 200 tweets at once for when you need to catch up.
iSSH ($4.99): Imagine being able to SSH from your iPhone! iSSH saves connections, so at a tap, you can connect to your home computer or even your web server. So much can be accomplished via the terminal, like checking cron jobs, editing a website, starting a video encode, and I love being able to do it when I am out and about.
Yes, some of these aren't free and people seem to be against that for some reason. But these cost less than a lunch, and will last much longer and be more useful than a single lunch. You won't miss the few dollars, and you'll feel good about supporting these talented developers.
What are some of your favorite iPhone apps?
Jan
2009
3:27 PM | Comments (0)
As with any other college, trying to get the classes you want at Virginia Tech can be difficult when they're full. Most people are left to waste time refreshing the class timetable. Well I decided to make the computer work for me and tell me the minute a class opens up.
I really wanted a class at 11am on Tuesdays and Thursdays, and I saw "Music Theory and Fundamentals" was at that time. I play piano and want to learn more about making music, so I thought it'd be an interesting class to take, but it was full and chances looked slim at catching it open. So I wrote a Perl script to check the timetable every minute (because that's the fastest a cron job will let me) and then send me a text message when there is an opening in the class. Here is the final masterpiece:
#!/usr/bin/perl -w
use strict;
use WWW::Mechanize;
use HTML::TokeParser;
my $crn = "14484";
my $agent = WWW::Mechanize->new();
$agent->get("https://banweb.banner.vt.edu/ssb/prod/HZSKVTSC.P_ProcRequest");
$agent->form_number(1);
$agent->field("crn", $crn);
$agent->click();
my $stream = HTML::TokeParser->new(\$agent->{content});
$stream->get_tag("table");
$stream->get_tag("table");
$stream->get_tag("table");
$stream->get_tag("table");
$stream->get_tag("table");
$stream->get_tag("tr");
$stream->get_tag("tr");
$stream->get_tag("td");
$stream->get_tag("td");
$stream->get_tag("td");
my $classname = $stream->get_trimmed_text("td");
$stream->get_tag("td");
$stream->get_tag("td");
$stream->get_tag("td");
$stream->get_tag("p");
my $status = $stream->get_trimmed_text("/b");
my $now = localtime time;
open(httpd_log, ">>/Users/kevin/cronlog.txt");
print httpd_log "[$now] [$crn] $classname: $status\n";
close httpd_log;
if ($tag ne "Full") {
open (MAIL, "|/usr/sbin/sendmail -t ");
print MAIL "From: k\@vt.edu\n";
print MAIL "To: phonenumber\@txt.att.net\n";
print MAIL "Content-Type: text/plain\n";
print MAIL "Subject: $classname ($crn)\n\n";
print MAIL "$status";
close (MAIL);
} else {
# else...
}Actually, it's not that great of a script. There are some bugs, but the basic features are in there that I want to show you. (WARNING, GEEK CONTENT) It requires the latest versions of WWW::Mechanize and WWW::TokeParser. Mechanize will let you submit forms, which I needed because the timetable doesn't pass variables through the URL. TokeParser is then used to grab text from the site. All those $stream->get_tag() functions tell TokeParser where to go on the page, and assign variables to certain text on the way down.
Why a cron job? Why not a loop with a sleep function? The script would crash after a few hours, mainly because the timetable isn't very reliable. I didn't feel like building in error handling, so I set up a cron job so I know the script would run every minute no matter what happens. I had it output the results into a log so I would know the script was still working, and I would embed it on my desktop with GeekTool. It would look like this:
[Thu Jan 8 09:18:02 2009] [15312] Introduction to Acting: Full [Thu Jan 8 09:18:02 2009] [14484] Theory/Fundamentals: 1 / 60 [Thu Jan 8 09:19:02 2009] [15312] Introduction to Acting: Full [Thu Jan 8 09:19:02 2009] [14484] Theory/Fundamentals: 1 / 60
I was also watching Intro to Acting as a backup, which also had the same timeslot. This is the point in the log in which there was an opening in the class and it sent me a text message. It was awesome to know that I actually pulled it off and that it all worked. I could have even had the script log into the class drop/add system and add the class for me, but I thought I'd just do it myself once I got the text message.
So there it is kids, this is my last semester so I won't be needing it anymore. I hope you've learned something, and leave a comment if you have any questions.
Jan
2009
10:24 PM | Comments (2)

Just got back from the Orange Bowl recently and took some decent photos. Check out the Flickr for more.
I'm awesome at neglecting blogs. I just wanted to post and say I'm still alive. I usually have great ideas for blog posts, but then I'm like, "Well no one is going to read it," so then I don't blog. But I guess you have to blog good content to get an audience, I suppose I'll try.