Closure is a Google tool for intelligently optimising - minifying - your Javascript. There's a command-line tool, an online version and a REST API.
Here's a quick Ruby script for accessing the REST API:
Posted on 8 November 2009
Flickr GitHub Twitter