
Untitled
By: a guest on
Jun 18th, 2012 | syntax:
JavaScript | size: 1.35 KB | hits: 22 | expires: Never
$(document).ready(function() {
window.fbAsyncInit = function() {
FB.init({
appId : '477400305610609',
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
FB.login(function(response) {
if (response.authResponse) {
console.log('Welcome! Fetching your information.... ');
var attachment = {
'name' : '¡Yo resolví la trivia y estoy participando por un Samsung Galaxy SIII!',
'caption': 'http://www.facebook.com/movistarperu/app_477400305610609',
'link': 'http://www.facebook.com/movistarperu/app_477400305610609',
'picture': 'http://samsunggalaxysiii.serviciosmovistar.com/images/ico-compartir.jpg'
};
FB.api('/me/feed', 'post', { message: attachment }, function(response) {
// lo que quelas
});
}
else {
console.log('User cancelled login or did not fully authorize.');
}
}, {scope: 'publish_stream'});
};
(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));
});