Search VersionTracker from the command line

Jul 29, '02 11:44:48PM

Contributed by: daeley

I've been getting a smidgen irritated by the time it takes for a certain application tracking site's homepage to load, especially when all I want to do is a fast "QuickSearch" on particular keywords in the Mac OS X directory.

Ah, the power of UNIX, allowing "lazy hackers" to waste tons of time creating simple solutions to life's problems! :) In that spirit, I wrote a Perl script to allow keyword searches on VersionTracker from the command line, which then opens up the results in your favorite browser.

Read the rest of the article for the script...

#!/usr/bin/perl -w
#######
# This is a spiffy script written by Robert Daeley to
# search VersionTracker sans loading their frickin' big
# honkin' homepage. With the encouragement of cohort Hans Hickman.
# 27 7 2002 version 0.9.9
#######
# User-specified variables are below.
# To use, simply type ./vtsearch.pl (or whatever you name the script).
# A blank line will appear. Type keyword you want to search by and hit return.
# $browser can be any webbrowser's full name

$browser = "OmniWeb";

#### LEAVE EVERYTHING BELOW AS IS ####

$filter = "MacOSX";
print "Search string: ";
$keyword = <STDIN>;
chomp($keyword);
$url = "http://www.versiontracker.com/mp/new_search.m?productDB=mac&
mode=Quick&OS_Filter=".$filter."&search=".$keyword."&x=0&y=0";
$todo = "\'Tell application \"$browser\" to getURL \"$url\"\'";
system("osascript -l AppleScript -e $todo");
IMPORTANT NOTE: The "$url" line has been split into two for easier reading. Enter it as one line with no spaces between the "&" and "mode". Save the script somewhere in your path, make it executable (chmod 755 Script_Name) and then run it to search VersionTracker. Enjoy and feel free to elaborate. I will leave it as an exercise for the reader to enable searches on VT's other DBs.

Comments (25)


Mac OS X Hints
http://hints.macworld.com/article.php?story=2002072923444892