This project has moved and is read-only. For the latest updates, please go here.

How to Get Public Timeline

Feb 18, 2013 at 3:39 AM
I can't figure out how should i get the Twitter public timeline with linq2twitter.
There is no documentation on this, no samples, nothing!
can anyone help me please ?
Feb 18, 2013 at 3:46 AM

The public timeline isn't available anymore. Twitter API v1.0, which supported public timeline, is now deprecated and the new Twitter API v1.1 doesn't have public timeline. Twitter will be performing blackouts on API v1.0 and eventually turn off the entire v1.0 API starting next month. LINQ to Twitter now supports Twitter API v1.1.

An alternative would be to use the Sample Stream, which LINQ to Twitter does support.

Feb 18, 2013 at 7:31 PM
Thanks Joe,
Will LINQ to Twitter have sample stream support in a near future or do you know any alternative way to work with sample stream except using Twitter API directly? I'm working on a mining project and I'm in dire need of a this feature.
Feb 18, 2013 at 8:13 PM
Yes, LINQ to Twitter supports Sample Stream:

The downloadable source code has examples too.

Feb 26, 2013 at 5:37 PM
First up, apologies if it looks like I'm trying to hijack this thread. I think I'm trying to do the same thing (retrieve the public timeline) but could do with a bit of guidance.

I'm currently retrieving a list of public timline tweets with the following:

IQueryable<LinqToTwitter.Status> queryResponse =
                from tweet in twitterContext.Status
                where tweet.Type == StatusType.User && tweet.ScreenName == twitterUserName && tweet.Count == tweetCount && tweet.IncludeRetweets == true
                select tweet;
However, I've noticed that Status.IncludeRetweets is obsolete. Is there a better way to approach this?

If the answer is to use Sample Stream, can you point me to the code examples? I couldn't find any on the link above.

Thanks in advance for any help - it's much appreciated.
Feb 26, 2013 at 8:16 PM
Edited Feb 26, 2013 at 8:20 PM
It's a typo, the correct address is :
To use status samples you need to pass in your username and password in plain text where defined (basic auth). The response is a raw json response which you need to parse by either using the UserStreamParser project which you can find in codeplex, It's a little old so you need to change some parts of it as you wish.
This is my code to get sample stream using custom UserStreamParser to parse the json response:
using (var twitterCtx = new TwitterContext(auth))

                    twitterCtx.StreamingUserName = _username;
                    twitterCtx.StreamingPassword = _password;

                    if (twitterCtx.StreamingUserName == string.Empty ||
                        twitterCtx.StreamingPassword == string.Empty)
                        Console.WriteLine("\n*** This won't work until you set the StreamingUserName and StreamingPassword on TwitterContext to valid values.\n");

                    var streams = from strm in twitterCtx.Streaming
                                  where strm.Type == StreamingType.Sample
                                  select strm;
                    var parser = streams.CreateParser();
                    parser.ReceivedStatus += ParserReceivedStatus;              
        private void ParserReceivedStatus(object sender, StreamReceivedStatusEventArgs e)