Thanks for sharing, but I am really not happy to install PHP (or using it) on my local system. I see you state you may re-write it in Python, if this happens I look forward to trying it!
EDIT: Thanks teruakohatu for trying to help tho!
Sorry, just trying to help.