Reading twitter feed

后端 未结 2 1730
面向向阳花
面向向阳花 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.

    0 讨论(0)
  • 2021-01-15 06:40

    For reading feed, you have to authenticate first using token and key in dev.twitter.com site.

    Also, you can try TweetSharp library. https://github.com/danielcrenna/tweetsharp.

    Update 19/10/2016:
    The Github danielcrenna/TweetSharp is not available any more.
    From https://github.com/shugonta/TweetSharp

    this project is officially archived / dead....
    If you need commercial and/or active support for a Twitter-based API wrapper, you may want to orient your organization towards alternatives like Twitterizer or LINQ to Twitter.

    However Nuget package TweetSharp is still available (Last updated 2013-06-22)

    0 讨论(0)
提交回复
热议问题