1

Closed

I can't get streaming to work

description

From what I can tell a 'Status' is a 'Tweet'. So based on the samples this code should give me a list of Tweets:
            Debug.WriteLine("\nStreamed Content: \n");
            int count = 0;

            // the user stream is for whoever is authenticated
            // via the Authenticator passed to TwitterContext
            (from strm in twitterCtx.UserStream
             where strm.Type == UserStreamType.User
             select strm)
                .StreamingCallback(strm =>
                    {
                        if (strm.Status == TwitterErrorStatus.RequestProcessingException)
                        {
                            Debug.WriteLine(strm.Error.ToString());
                            return;
                        }

                        Debug.WriteLine(strm.Content + "\n");

                        if (count++ >= 25)
                        {
                            strm.CloseStream();
                        }
                    })
                .SingleOrDefault();

The call back never gets called. Which I guess means that there are no messages. When I login to my Twitter account I see a list of 'Tweets'
Closed Feb 15, 2013 at 2:29 AM by JoeMayo

comments

JoeMayo wrote Feb 15, 2013 at 2:28 AM

Hi,

The streams return real-time information. So, you'll need to start tweeting when the stream is running to see output. When testing this, I'll also find one of my own tweets and favorite/unfavorite a few times to make sure the stream is working.

You also need to perform OAuth authorization. The downloadable source code has a project with samples, which also includes streaming demos.

Joe