dsandrei:
Script is here:
http://tinyurl.com/cky2ojr
I have added some comments and some variables so people can adapt it for their own use. It should go without saying that people shouldn't run it without checking it for themselves as it was written purely for my own use and is probably quite rubbish and may break everything (and apologies in advance to anyone who can actually code and is offended by my hackery).