Reading twitter feed

后端 未结 2 1746
面向向阳花
面向向阳花 2021-01-15 06:02


Previously I was using

http://api.twitter.com/1/statuses/user_timeline.json?include_entities=true&include_rts=true&screen_name=xyz&count=5         


        
2条回答
  •  温柔的废话
    2021-01-15 06:38

    Here's how you do it with LINQ to Twitter. Use a StatusType.User query, like this:

            var statusTweets =
                (from tweet in twitterCtx.Status
                 where tweet.Type == StatusType.User &&
                       tweet.ScreenName == "xyz" &&
                       tweet.IncludeEntities == true &&
                       tweet.IncludeRetweets == true &&
                       tweet.Count == 5
                 select tweet)
                .ToList();
    
            var jsonData = twitterCtx.RawResult;
    

    The RawResult property of the TwitterContext instance contains the JSON data that Twitter returns. So, you have a choice of using the deserialized tweets or the raw data that Twitter returns.

提交回复
热议问题