-
-
Save imryanjay/5474007 to your computer and use it in GitHub Desktop.
Trying to figure out what posting comments through Facebook's graph API only sometimes works
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
$(document).on('click', '.comment_submit', function(e) { | |
var $this = $(this); | |
var post_id = $this.closest('.box').attr('data-post_id'); | |
var comment = $this.siblings('.comment_form').val(); | |
$.ajax({ | |
type: 'GET', | |
url: 'interactions/facebook.interaction.php', | |
data: { | |
post_id: post_id, | |
comment: comment, | |
interaction: 'commenting' | |
}, | |
//dataType: 'json', | |
success: function(data) { | |
console.log('true'); | |
}, | |
error: function(data) { | |
console.log('error'); | |
} | |
}); | |
}); |
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
$interaction = $_GET['interaction']; | |
$post_id = $_GET['post_id']; | |
$comment = $_GET['comment']; | |
if( $interaction === 'commenting' ) { | |
$reply = $facebook->api('/' . $post_id . '/comments?message=' . $comment . '&access_token=' . $accessToken, 'post'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment