Created
July 23, 2012 15:49
-
-
Save colmdoyle/3164337 to your computer and use it in GitHub Desktop.
Petition OG Example
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang=""> | |
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# dc-trip: http://ogp.me/ns/fb/dc-trip#"> | |
<title> Petition </title> | |
<meta property="fb:app_id" content="438840122827431" /> | |
<meta property="og:type" content="dc-trip:petition" /> | |
<meta property="og:url" content="https://colmd.fbdublin.com/dc-trip/petition.php" /> | |
<meta property="og:title" content="Free donuts for all" /> | |
<meta property="og:image" content="http://www.amend2012.org/atf/cf/%7B5457E9EC-EF4A-4F33-BA1B-305FF743FDF9%7D/signthepetition_icon.gif" /> | |
<meta property="og:description" content="We the people, love donuts" /> | |
</head> | |
<body> | |
<div id="fb-root"></div> | |
<script> | |
window.fbAsyncInit = function() { | |
FB.init({ | |
appId : '438840122827431', // App ID | |
channelUrl : '//COLMD.FBDUBLIN.COM/channel.html', // Channel File | |
status : true, // check login status | |
cookie : true, // enable cookies to allow the server to access the session | |
xfbml : true // parse XFBML | |
}); | |
// Additional initialization code here | |
}; | |
// Load the SDK Asynchronously | |
(function(d){ | |
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0]; | |
if (d.getElementById(id)) {return;} | |
js = d.createElement('script'); js.id = id; js.async = true; | |
js.src = "//connect.facebook.net/en_US/all.js"; | |
ref.parentNode.insertBefore(js, ref); | |
}(document)); | |
</script> | |
<script type="text/javascript"> | |
function sign() | |
{ | |
FB.api( | |
'/me/dc-trip:sign', | |
'post', | |
{ petition: 'https://colmd.fbdublin.com/dc-trip/petition.php' }, | |
function(response) { | |
if (!response || response.error) { | |
alert('Error occured'); | |
} else { | |
alert('Cook was successful! Action ID: ' + response.id); | |
} | |
}); | |
} | |
</script> | |
<p> | |
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris ut ipsum quam. Nulla facilisi. Vestibulum imperdiet imperdiet turpis nec viverra. Cras sed sapien purus, non dignissim enim. Suspendisse potenti. Mauris sollicitudin, libero eu elementum dignissim, mi sapien rhoncus augue, suscipit volutpat lectus tortor eu massa. Maecenas at molestie lectus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Etiam auctor sapien vitae velit lobortis quis aliquam risus ultricies. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Praesent semper eleifend nisl, in bibendum arcu laoreet sit amet. Nulla id augue lorem, eu ornare nisl. Curabitur tincidunt fermentum magna sit amet fermentum. | |
</p> | |
<p> | |
<a href="#" onclick=" FB.login(function(response) { | |
// handle the response | |
}, {scope: 'email,publish_actions'});"> Login </a> | |
</p> | |
<p> | |
<a href="#" onclick="sign()">Sign</a> | |
</p> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment