Script is up here:http://gist.github.com/322512Comments and criticism appreciated. Please feel free fork it and make your own modifications and improvements if it is useful to you.
http://gist.github.com/332920