JSFiddle - React, Tailwind, and code Playground

by Alin Guta

HTML

<div id="facebookfeed">
 <h2>Loading...</h2>
 </div>

JavaScript

$(function(){
 //Set Url of JSON data from the facebook graph api. make sure callback is set with a '?' to overcome the cross domain problems with JSON
 var url = "https://graph.facebook.com/fql?q=SELECT%20url,%20normalized_url,%20share_count,%20like_count,%20comment_count,%20total_count,commentsbox_count,%20comments_fbid,%20click_count%20FROM%20link_stat%20WHERE%20url=%27http://www.google.com%27";

 //Use jQuery getJSON method to fetch the data from the url and then create our unordered list with the relevant data.
    $.getJSON(url,function(json){
        console.log(JSON.stringify(json));
        $('#facebookfeed').animate({opacity:0}, 500, function(){
            $('#facebookfeed').html("<h2>"+json.data[0].total_count+"</h2>");
        });
        $('#facebookfeed').animate({opacity:1}, 500);
 
    });
});