Skip to content

Instantly share code, notes, and snippets.

@boertel
Created May 3, 2012 21:26
Show Gist options
  • Save boertel/2589651 to your computer and use it in GitHub Desktop.
Save boertel/2589651 to your computer and use it in GitHub Desktop.
Share on facebook
// call the Facebook API
message = {
name: $(this).attr("data-name"),
link: $(this).attr("data-url"),
caption: $(this).attr("data-caption"),
description: $(this).attr("data-description"),
picture: "http://static.punchtab.com/ebay/images/ebay-sharing-image.png",
message: "What's in my mind?"
}
FB.api("me/feed", message, function (response) {
...
});
// show a Facebook popup
FB.ui({
method: "feed",
name: $(this).attr("data-name"),
link: $(this).attr("data-url"),
caption: $(this).attr("data-caption"),
description: $(this).attr("data-description"),
picture: "http://static.punchtab.com/ebay/images/ebay-sharing-image.png",
display: "popup"
});
More:
https://developers.facebook.com/docs/reference/rest/stream.publish/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment