Email alerts for Facebook comment box social plugin

I like the Facebook comments box social plugin. But what I don't like about it is the lack of any easy backup option and also a handy notification system. Would it not be nice (for a low traffic blog like this one) if the author gets notified of each comment made on the blog? Even better if in this process, the comments are archived in a spreadsheet! Here's how you can easily install such a system on your blog/site too.

Throughout this post, I assume that you have already set up the Facebook comments box social plugin on your site. If not, just Google for "how to install facebook comments social plugin"!

I have written a Google app script which
  1. Creates a Google form for the Facebook comments.
  2. Adds code to the form so that whenever a new entry is submitted, a mail will be sent to your account.
  3. Gives you the code which hooks the Google form to your Facebook comments installation.
Just click on this link and grant it the required permissions and everything will be taken care of! If you do not trust that script, here is the code for the same script, you can read through that code, and after verifying that it does not do any untoward things, you can just copy-paste that code and make your own Google cloud app!

After the execution of the app, you would see that the browser has some JavaScript code. Copy the whole code except the first and last line, as shown in this image:
Given the fact that you already had Facebook comments installed on your site, it is fair to assume that you know what FB.Event.subscribe does and where one should put the code copied from above.

Blogger users:
Let's say that you just followed some online tutorial and installed the Facebook comments plugin for your blog, but don't really know what to do with the above code. Here you go...
Edit the HTML template of your blog.
In the template code, look for "window.fbAsyncInit" and right after the call to FB.init, add the code obtained from above steps. If your template did not have window.fbAsyncInit, then simply add the code shown below, obviously with your own appId, not mine!
Adding the above obtained code.
Click on "Save template" and you are all set!

Note: You will need jquery installed on your blog. It is very easy, just 2 minutes work. Search google for "installing jquery on blogger".

Here's an example mail sent by this code when a Facebook comment is made:

No comments :

Post a Comment

Note: Only a member of this blog may post a comment.