Skip to content

hassanbarber/Number-of-shares-and-comments-of-a-post-Url

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

Number-of-shares-and-comments-of-a-post-Url

Number of shares and comments of a post Url var postUrl = location.href;

var get_fbcount = function() {

$.getJSON('https://graph.facebook.com/' + postUrl, function(data) {

var commentcount = data.share.comment_count;

console.log(data);

if (commentcount) {

  $('.comment_count').append(commentcount);

} else {

  $('.comment_count').append(0);

}

var sharecount = data.share.share_count;

console.log(data);

if (sharecount) {

  $('.share_count').append(sharecount);

} else {

  $('.share_count').append(0);

}

});

};

get_fbcount();

About

Number of shares and comments of a post Url

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published