You can repeat the function every tot seconds, like 5 seconds. I don't know about this socket API, but the biggest problem is the SSL protocol. You must buy it or nothing, the requests HTTP>to HTTPS won't work.
I already have a script working that way.
The advantage of using websocket is that I'd get a live stream of trades instead of comparing arrays to eachother.
That would make me use less processor resources while keeping the load on their servers minimal.
It's also easier to trigger functions sequentially instead of checking for timeouts on requests so previous data wouldn't get mixed up with more recent data.
I'll try to post it in the forum mentioned before after i get rid of my newb status..