LoklakDotNet.Loklak.user C# (CSharp) Method

user() public method

This servlet provides the retrieval of user followers and the accounts which the user is following.
public user ( string screen_name, int follower_count, int following_count ) : Task
screen_name string The screen name of the Twitter user without "@"
follower_count int The maximum number of follower profiles to be fetched
following_count int The maximum number of following profiles to be fetched
return Task
        public async Task<string> user(string screen_name, int follower_count=0, int following_count=0)
        {
            Dictionary<string,string> qs = new Dictionary<string,string>();
            qs.Add("screen_name", screen_name);
            qs.Add("followers", follower_count.ToString());
            qs.Add("following", following_count.ToString());
            return (await ProcessUrlAsync("user.json", qs));
        }

Usage Example

Example #1
0
 public async Task user()
 {
     Loklak loklak = new Loklak();
     var result = await loklak.user("loklak_app", 5, 5);
     var d = JObject.Parse(result);
     Assert.IsNotNull(d.Property("user"));
     Assert.AreEqual(((JObject)(((JObject)d.GetValue("user")))).GetValue("id").ToString(), "3090229939");
     Assert.IsNotNull(d.Property("topology"));
     Assert.IsTrue(((JArray)(((JObject)(d.GetValue("topology"))).GetValue("following"))).Count >= 5);
     Assert.IsTrue(((JArray)(((JObject)(d.GetValue("topology"))).GetValue("followers"))).Count >= 5);
 }