Here's a command-line client for speedtest.net, written in Python:
https://github.com/sivel/speedtest-cli
I don't know Python and am not familiar with the testmy.net API (I assume there's one) at all.
Just wanted to share, someone may be able to build something off of that.