Since I have no use for it anymore, here is the script[0]. I wrote most of it during a free period :D
[0] https://gist.github.com/siraben/c3133b39e470d1aed16fd71f42b8...
[0] https://gist.github.com/siraben/c3133b39e470d1aed16fd71f42b8...
[0] https://gist.github.com/siraben/c3133b39e470d1aed16fd71f42b8...