Example #1
0
        public static async void GetPersonalityInfo(User user)
        {            
            var bio = user.bio;
            string statusMessages = "";
            foreach (var item in user.posts.data)
	        {
                statusMessages += item.message;		 
            }
            var inputText = bio + ". " + statusMessages;
            using(var httpClient = new HttpClient())
	        {
                var stringData = new StringContent(JsonConvert.SerializeObject(new { text = inputText}),Encoding.UTF8,"application/json");
                var response = await httpClient.PostAsync(baseApiUrl + "/map", stringData);
                var json = await response.Content.ReadAsStringAsync();
                user.personality = json;
                //Console.WriteLine("Personality : " + json);
                /*
                 * .ContinueWith(r =>
                {
                    string json = r.Result.GetResponseText();
                    user.personality = json;
                });
                 */
            }
        }
Example #2
0
 private AppData()
 {
     OAuth = new OAuth(clientId: "1639469262962972",  		// your OAuth2 client id
                         scope: "public_profile,email,user_friends,user_about_me,user_status",  		// The scopes for the particular API you're accessing. The format for this will vary by API.
                         authorizeUrl: "https://m.facebook.com/dialog/oauth/",  	// the auth URL for the service
                         redirectUrl: "http://www.facebook.com/connect/login_success.html");
     User = new User();
 }