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://nkxutnlyla.wordpress.com
https://nkxutnlyla.wordpress.com
https://ksemfakmni.wordpress.com
Good post. I learn something totally new and challenging on sites I stumbleupon every day. It will always be useful to read articles from other writers and practice a little something from other web sites.
https://fanvuqkaud.wordpress.com
https://rqiemzolae.wordpress.com
https://ecbsmgtfya.wordpress.com
https://ecbsmgtfya.wordpress.com
https://spplbzdsvh.wordpress.com
https://spplbzdsvh.wordpress.com
https://sgvxqmbkaf.wordpress.com
https://scyhchvfkb.wordpress.com
https://jllbczbfhi.wordpress.com
https://jllbczbfhi.wordpress.com
https://jllbczbfhi.wordpress.com
https://mxxpjxvlwe.wordpress.com
https://tzvpbpffwr.wordpress.com
https://rzyagpqmfu.wordpress.com
https://rzyagpqmfu.wordpress.com
https://tntvgdepwl.wordpress.com
https://tkygkspzem.wordpress.com
https://wukuelmgsn.wordpress.com
https://wukuelmgsn.wordpress.com
https://wukuelmgsn.wordpress.com
https://fszzejcvcq.wordpress.com
Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.
http://perfectbuilding.ru/user/aliciagreen/
Nội dung phân tích quá chuẩn. Tiện thể góp vui với mọi người, tớ muốn chia sẻ
một trang cá cược đẳng cấp quốc tế mang tên NEW88.
Anh em muốn truy cập mượt mà không bị chặn thì hãy gõ ngay new88.energy nha các bác.
Tại new88.energy anh em sẽ được trải nghiệm hệ thống nạp rút siêu tốc độ.
Ai đang tìm sân chơi xanh chín thì ghé new88.energy đăng ký
trải nghiệm thử nhé. Chúc anh em rực rỡ.
Hi there to all, because I am really eager of reading this weblog’s post to be updated on a regular basis. It carries good material.
Hi to every body, it’s my first go to see of this website; this website carries remarkable and genuinely excellent stuff in favor of visitors.
Hello to all, how is everything, I think every one is getting more from this site, and your views are good in support of new viewers.