This sounds very interesting. As far as I know, there are no automatic functions to do this, although i don't think it would be too hard to write the php function to do this. If end up finding a solution, please email it to me (and the list), or if you need a hand in writing it, I'd be happy to help.
Adam