ich von this page Informationen Kommentar (nach unten scrollen zu ** Kommentaren Plugin Code Generator * Abschnitt)Wie Facebook Kommentare kommen Kommentare Kommentare Informationen mit C#?
Ich verwende FacebookClient
Klasse von Facebook Nuget package zu holen versuchen, die Daten zu holen. Mein Code ist folgende:
string oauthUrl = $"https://graph.facebook.com/oauth/access_token?type=client_cred&client_id={appId}&client_secret={appSecret}";
string accessToken = client.DownloadString(oauthUrl).Split('=')[1];
// this is included as a sanity check that the client can fetch data (correct token, proper calls)
var fbClient = new FacebookClient(accessToken);
var fbData = fbClient.Get("/wikipedia/").ToString();
var info = JsonConvert.DeserializeObject<FacebookPageInfo>(fbData);
fbData = fbClient.Get("/wikipedia/posts").ToString();
var posts = JsonConvert.DeserializeObject<FacebookPostData>(fbData);
// this is the code the actually should fetch comments content
// this is the data-href value retrieved from inspecting rendered page
var pageUrl = HttpUtility.UrlDecode("https://developers.facebook.com/docs/plugins/comments#configurator");
var fbComments = fbClient.Get($"/{pageUrl}/comments");
aber ich erhalte nur ein JSON Ergebnis wie folgt ergeben:
{
"og_object": {
"id": "246649445486535",
"description": "The Comments box lets people comment on content on your site using their Facebook profile and shows this activity to their friends in news feed. It also contains built-in moderation tools and special...",
"title": "Comments - Social Plugins - Documentation - Facebook for Developers",
"type": "article",
"updated_time": "2017-02-09T22:53:10+0000"
},
"share": {
"comment_count": 0,
"share_count": 4226
},
"id": "https:\/\/developers.facebook.com\/docs\/plugins\/comments#configurator\/comments"
}
Frage: Wie kann ich aktuelle Kommentare Inhalt holen?
https://developers.facebook.com/docs/plugins/faqs#faq_1603507626630008 – CBroe