I really hate flying. Flying has 2 major drawbacks: one, it requires uncomfortable sitting in close quarters (note: I’m 6′3), and second, it almost never has internet. On long flights, I do what any other geek would – I end up programming. Quite often, bored and internet-less programming turns into solving some problem which has been solved many times before. This was one of those problems.
I needed a quick script which could rip through a list of hundreds of urls and evaluate each url for an expected ‘200′ response value indicating that the website was ‘ok.’ If something other than a 200 was returned, I wanted to know about it. Performance speed was not a concern.
The solution was a dead simple Ruby program. Using a single .txt file, you can define all the people who need to receive notification, and all the URLs that need to be checked. You can easily automate the process by running the script as a cron task. That solved my problem and killed some time.