As you got it working, it's good.
Anyway it's also possible to use similar script in web-browser console (F12 key), so here is my script, tested in Firefox. Edit the search link to filter activities…
You could delete all your activities, insure the default privacy setting in you account settings is what you want it to be, then upload all your activities again.
Hi WillNorthYork,
Is your script still working? I am getting "Exception: Did not get a ticket in the login response." although the credentials I am using are working fine when I am logging in on the web interface for instance.
Also, thank you for your work!