Can't help with a custom script but there are some software's available for purchase that I've used like IPTimelapse and Blue Iris to ftp images to website and WU. Good luck with WU, on a good day I could get maybe a dozen images uploaded. Their servers were very overloaded so stopped sending images over a year ago.
I only upload images to my personal website now.