Created
February 19, 2010 21:07
-
-
Save facebook/309210 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="fb-root"></div> | |
<script src="http://static.ak.fbcdn.net/connect/en_US/core.js"></script> | |
<div id="content"> | |
<div align="right"><fb:login-button autologoutlink="true" v="2"></fb:login-button><br> | |
<button onClick="triedIt();">I Tried This!</button> | |
</div> | |
<h1>Recipes For You on Facebook</h1> | |
<h3>Peanut Butter and Jelly Sandwich</h3> | |
2 slices bread<br> | |
1 T peanut butter<br> | |
1 T jelly<br> | |
<br> | |
Using knife, spread peanut butter on one slice of bread. Using a clean knife, | |
spread jelly on the other slice. Put slices together so that the peanut butter | |
and jelly meet. If desired, cut into squares or triangles. | |
<center> | |
<fb:share-button href="http://apps.facebook.com/example" type="button_count"> | |
</fb:share-button> | |
</center> | |
</div> | |
<script> | |
function triedIt(){ | |
var post = { | |
message: 'I tried the Peanut Butter Sandwich recipe.', | |
attachment: { | |
name: 'Recipes', | |
description: ( | |
'This is the site to go to for great recipes!' | |
), | |
href: 'http://www.yoursite.com' | |
}, | |
action_links: [ | |
{ | |
text: 'Check Out the Recipes', | |
href: 'http://www.yoursite.com' | |
}, | |
], | |
user_prompt_message: 'Share your thoughts about the Peanut Butter Sandwich recipe!' | |
}; | |
FB.publish( | |
post, | |
function(published_post) { | |
if (published_post) { | |
alert( | |
'The post was successfully published. ' + | |
'Post ID: ' + published_post.post_id + | |
'. Message: ' + published_post.message | |
); | |
} else { | |
alert('The post was not published.'); | |
} | |
} | |
); | |
} | |
</script> | |
<script> | |
FB.init({ | |
apiKey: 'YOUR_API_KEY', | |
status: true | |
}); | |
FB.XFBML.parse(); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment