Priya
Priya

Reputation: 1425

Reading twitter feed


Previously I was using

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

to read the twitter feeds. But after the arrival of twitter api 1.1, I am getting Bad Authentication data error. Am I missing something to be done?

Thanks,
Priya

Upvotes: 2

Views: 10404

Answers (2)

Deepu Madhusoodanan
Deepu Madhusoodanan

Reputation: 1505

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)

Upvotes: 2

Joe Mayo
Joe Mayo

Reputation: 7513

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.

Upvotes: 4

Related Questions