json - Facebook API C# - How to get the result? -
i got problem code on here , im googling around 3 hours now. i'm doing fql-query , i'm trying read result. unfortunately.. dont know how.. found answers question none seems help..
var fbclient = new facebookclient(accesstoken); dynamic result = (idictionary<string, object>)fbclient.get("fql", new { q = new[] { "select name user uid = me()", "select unread_count mailbox_folder folder_id = 4 , viewer_id = me()", "select is_unread notification recipient_id = me()", "select unread friend_request uid_to = me()" } }); string name = ""; foreach (dynamic data in result.data) { name = data.name; }
and last part (foreach) doesn't work out - last thing tried
thanks advice!
regards, danny
well. answering own question now. took while figured out how infos out of fql-multi-query. search same:
dynamic result = fbclient.get("fql", new { q = new[] { "select unread_count mailbox_folder folder_id = 0 , viewer_id = me()", "select is_unread notification recipient_id = me()", "select unread friend_request uid_to = me()" } }); var unread_messages = result["data"][0]["fql_result_set"][0]["unread_count"]; var notifications = result["data"][1]["fql_result_set"]; var open_friendrequests = result["data"][2]["fql_result_set"];
that's i've ever wanted ;o)
best regards,
danny
Comments
Post a Comment