I have made a chrome extension for facebook, for private liking. What I want to do is, whenever someone posted a post, and a person clicked the private like button, which has been included by me. On click of this private like button, i want to get the JSON data of the poster who posted the post. For now i just tried to get JSON of my own profile, but It does not return anything. Below is the code !
var btn = "<button class=\"nadddim\" >Get JSON</button>";
var t = document.getElementsByClassName("_sg1 _3qd4");
t[0].insertAdjacentHTML('beforebegin', btn);
document.getElementsByClassName('nadddim')[0].addEventListener('click',function(){
var fbjson;
$.getJSON( "https://www.facebook.com/profile.php?id=100004774025067", function( data ) {
fbjson = data;
});
console.log(fbjson);
});
Basically need the user id , from his post, for example John posted something, whenever I privately liked that post, I want to get the JSON of John to extract his id value ! Thats All I need