You need to create an event listener. It basically 'watches' the like button and 'snitches' when someone clicks on it
Add this somewhere in the head of your document
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script type="text/javascript">
$(document).ready(function() {
FB.init({ apiKey: 'xxxxxxxxxxxxx' });
});
</script>
Now we add the snitch
window.fbAsyncInit = function() {
FB.Event.subscribe('edge.create', function(href, widget) {
alert('You just liked the stUrbs URL '+href);
});
//Add the comment snitch here if you need it. Shown below
};
You can go further and snitch when someone adds a comment:
FB.Event.subscribe('comment.create', function(href, widget) {
alert('You just commented on stUrbs URL '+href);
});
Naturally, you'll want to do something more elegant than alerts