Skip to content

Instantly share code, notes, and snippets.

@yaplex
Created June 19, 2017 18:43
Show Gist options
  • Save yaplex/92f3bcc1535dc322fb25917dfedb1966 to your computer and use it in GitHub Desktop.
Save yaplex/92f3bcc1535dc322fb25917dfedb1966 to your computer and use it in GitHub Desktop.
dynamic messagePost = new ExpandoObject(); messagePost.picture = "https://yaplex.com/media/default/logos/yaplex.png";
messagePost.link = "https://yaplex.com/"; messagePost.name = "[name] Facebook name..."; // "{*actor*} " + "posted news...";
//<---{*actor*} is the user (i.e.: Alex) messagePost.caption = "[caption] Facebook caption"; messagePost.description =
"[description] Facebook description..."; messagePost.message = "[message] Facebook message..."; string acccessToken = "xxxx5120330xxxx|4xxxxx0c0f95bd3f62dxxxxx.1-10000xx4x73xxxx|2xx5xxx0566xxxx|z2xxxx37dxxxxsdDS23s_Sah34a";
FacebookClient appp = new FacebookClient(acccessToken); try { var postId = appp.Post("24351740xxxxxx" + "/feed", messagePost);
} catch (FacebookOAuthException ex) { //handle oauth exception } catch (FacebookApiException ex) { //handle facebook exception
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment