Nas últimas semanas procurei bastante e testei diversos plugins para adicionar a caixa de comentário do Facebook e os botões Like. Nos meus testes o que fez o proposto com mais facilidade foi o Plugin Total Facebook.
Já que o Facebook não notifica automaticamente sobre novos comentários e Likes eu decidi utilizar o Javascript SDK para verificar quando um comentário ou Like são feitos e fazer uma requisição (ajax) a uma página que seria a responsável por me notificar.
Diversos testes meus, retornavam que o objeto FB era inexistente (Uncaught ReferenceError: FB is not defined), que o FB.init já havia sido chamado (FB.init has already been called – this could indicate a problem) e outros erros. Então, modifiquei a função fbsdk_includeWFC() para fazer inicialização assincrona e cadastrei um método para ser chamado quando os eventos “comment.create” (comentário) e “edge.create” (like) forem disparados.
[code lang=”php”]
function fbsdk_includeWFC(){
$wfcglb = get_option(‘wfc_global’);
echo ”
window.fbAsyncInit = function() { FB.init({ appId : '" . $wfcglb['appid'] . "', // App ID //channelUrl : '//WWW.YOUR_DOMAIN.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 });
FB.Event.subscribe('comment.create', function (response) { jQuery.ajax({ url: 'test.html', //success: function (data) { alert(response.href); }, //error: function (data) { alert(response.href); } }); }); };
FB.Event.subscribe('edge.create', function (response) { jQuery.ajax({ url: 'test2.html', //success: function (data) { alert(response); }, //error: function (data) { alert(response); } }); }); };
(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));“;
echo ““;
}
[/code]
Agora você pode modificar as funções adicionadas em event.subscribe, fazer uma requisição para uma página PHP, passando como parametro a referencia e esta pagina ficara responsavel por enviar um e-mail para você.
Matheus
https://masto.nu/@madelyn541
https://masto.nu/@madelyn541
Heeya outstaning blog! Does rujnning a blig similar to this require a largee amount oof work?
I’ve absolutely nno knowledge of coding but
I had been hoping to staft my own blog soon. Anyways, should yoou have any ideas or tips foor new blog owners please share.
I know this is off topic however I simply wanted to ask.
Apporeciate it! xnxx
https://www.freewebmarks.com/user/heAnHlYt4oEj
https://www.freewebmarks.com/user/heAnHlYt4oEj
https://zzb.bz/ElXgQs
I’m impressed by the quality of this content! The author has obviously put a huge amount of effort into exploring and arranging the information. It’s exciting to come across an article that not only offers useful information but also keeps the readers engaged from start to finish. Hats off to her for making such a masterpiece!
https://commu.nosv.org/p/madelyn541/
https://topsitenet.com/profile/madelyn541/2651027/
https://undrtone.com/apricotrural
https://socialsocial.social/user/madelyn541/
https://www.flyingv.cc/users/1501957
Excellent pieces. Keep writing such kind of info on your blog. Im really impressed by your site.
http://jobboard.piasd.org/author/cultgtz15/
https://quomon.es/Profile/madelyn541/
https://bbs.kxwh.cn/?365150
https://n9.cl/242i2
http://www.jingsuanwu.com/home.php?mod=space&uid=31504
https://motion-gallery.net/users/1077049
http://www.isexsex.com/home.php?mod=space&uid=3188589&do=profile&from=space