We do indeed have crossdomain.xml disabled on stream.twitter.com. If that's
required, you'll have to wait a bit before deploying a Javascript solution.

If that isn't the problem, I'd suggest using tcpdump or some other wire
inspection tool and see what is transpiring directly. The Streaming API
often gives back a useful text nugget.

You may have hit a rate limit -- have a cuppa and wait 15 minutes and try
again.

And finally, as a last resort, you can email your account name and the time
of the error, in UTC, to this thread, or directly to me, and I'll poke
through the logs.

-John Kalucki
http://twitter.com/jkalucki
Infrastructure, Twitter Inc.



On Mon, Mar 15, 2010 at 5:06 PM, Lawrence <lipeng...@gmail.com> wrote:

> Hi Everyone,
> I am developing a Twitter program,which needs to get access for the
> Twitter streaming API. I can use Http Clients (Apache Wink) to get
> data from streaming API with no problem.
>
> However, my application needs to use JavaScript to access the
> Streaming API and receive data. I got failure in the first step:
> trying to pass the basic auth... Instead, i always got the 401 reply
> from twitter streaming api (unauthorized)
>
> Here is some snippet from my code,
> function send(arg)
>            {
>               CreateXMLHttpRequest();
>               xmlhttp.onreadystatechange = callhandle;
>
> xmlhttp.open("GET",url);
>               xmlhttp.setRequestHeader("Authorization", "Basic
> bXXXXXXXyZWXXXXXTY4OTE4dHxxlc==");
>   // for my account security reason, i changed the string for my
> password and user name, but I am pretty sure the string in my original
> code is correct because I got it from the printing of my successful
> http clients example.
>               xmlhttp.send(arg);
>           }
>
> Is this because the cross-domain restriction? Is there any way which i
> can use JS to access the streaming API to obtain data?
>
> Cheers
> Lawrence
>

Reply via email to