1. Have I completely missed the boat, and *there is* already something that does this?
I think it could be done via ruby and I assume python, perl etc. if you have the interpreter installed & language support compiled in. I once used ruby for that.
Thomas.