What am I doing wrong?
Since other member can confirm the code works, it's possible you're being rate limited or even blocked.
p.s. I could not find a better place to ask this question on BitcoinTalk.
I don't see any problem asking this question on this website. But you also could ask at Stack Overflow if you use their guideline to ask a good question.