Search code examples
twittertwitter-oauthtwitterizer

TwitterTimeline.HomeTimeline only returns my tweets


Why does the console app below, which uses the Twitterizer .NET library, only print out my tweets? As I understand it from Twitter's API documentation it should return tweets from the people I am following as well. The only thing I can think of is that it is something to do with using an access token I generated for my own account as described here, but I haven't been able to find anything that confirms that.

public class Program
{
    private const int ConsumerKey       = 0;
    private const int ConsumerSecret    = 1;
    private const int AccessToken       = 2;
    private const int AccessTokenSecret = 3;

    static void Main(string[] args)
    {
        OAuthTokens tokens = new OAuthTokens()
        {
            ConsumerKey       = args[ConsumerKey],
            ConsumerSecret    = args[ConsumerSecret],
            AccessToken       = args[AccessToken],
            AccessTokenSecret = args[AccessTokenSecret]
        };

        TwitterResponse<TwitterStatusCollection> response = TwitterTimeline.HomeTimeline(tokens);

        foreach (TwitterStatus status in response.ResponseObject)
        {
            Console.WriteLine(status.Text);
        }
        Console.ReadLine();
    }
}

Solution

  • Your code is correct. It should return the same data set that is displayed when you login to www.twitter.com.