Skip to content

Instantly share code, notes, and snippets.

@DHS
Created July 14, 2010 11:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DHS/475319 to your computer and use it in GitHub Desktop.
Save DHS/475319 to your computer and use it in GitHub Desktop.
stream.publish dialog in an FBML app
<?php
$attachment = array( 'name' => 'Name',
'href' => 'http://...'
);
$action_links = array( array( 'text' => 'Action link text',
'href' => 'http://'
)
);
echo '
<script type="text/javascript">
<!--
var message = "Just added something to my wishlist!";
var attachment = '.json_encode($attachment).';
var actionlinks = '.json_encode($action_links).';
Facebook.streamPublish(message, attachment, actionlinks);
//-->
</script>';
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment