开发者

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

开发者 https://www.devze.com 2022-12-25 05:59 出处:网络
I see there is a API call for Frienships/Show, but I am not sure how to parse the开发者_C百科 response to get the true/false.

I see there is a API call for Frienships/Show, but I am not sure how to parse the开发者_C百科 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?


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号