Sorry man, I have been so busy lately with other programming stuff. But, I would suggest using PHP as it is a much better solution for what you want. I will see if I can't create a script for you. May take a week but I will try and get something for you. At least something to start with.
Yeah .. right after I offered my help here, I ran into the same with general work (the sig work I posted elsewhere is actually a bit old itself, it just took that long to get around to posting it, and I haven't touched it since)
I'll take a glance at it again, now, I think ...