jpshook
jpshook

Reputation: 4944

How to see if a user is following you on Twitter using C# Twitter API wrapper Tweetsharp

I see there is a API call for Frienships/Show, but I am not sure how to parse the response to get the true/false.

Here is my code so far:

    var twitter = FluentTwitter.CreateRequest()
                    .AuthenticateAs(_userName, _password)
                    .Friendships().Verify(_userNameToCheck)
                    .AsJson();

    var response = twitter.Request();

Also, once authenticated, how to do set a user to follow you?

Upvotes: 0

Views: 1101

Answers (2)

Jason Diller
Jason Diller

Reputation: 3368

With TweetSharp you can access the friendships/exists API this way:

var twitter = FluentTwitter.CreateRequest()
                .AuthenticateAs(_username, _password)
                .Friendships()
                .Verify(_username).IsFriendsWith(_userNameToCheck)
                .AsJson();

There is no way to "set a user to follow you", they have to choose to follow you on their own.

Upvotes: 3

Michael Boggess
Michael Boggess

Reputation: 43

There is an API for that listed in the API Wiki. The document can be found here. This will simply return true if it user A is following user B. Here is a list of Libraries that probably support what your after.

Upvotes: 0

Related Questions