The code you posted is different than what I've seen in the past for connecting. I think (though I'm not sure) that oAuth is the preferred way of authenticating now.
Allain Lalonde
2010-09-03 14:56:59
The code you posted is different than what I've seen in the past for connecting. I think (though I'm not sure) that oAuth is the preferred way of authenticating now.
Yes, your authentication is not working because Twitter made some recent changes regarding how it lets 3rd party code authenticate.
In other words, Basic authentication has been turned off for the API.
As Allain mentions, oAuth is the way to go.