How do you use the Facebook API in the Google Chrome extension?

I am trying to access the information available by using the https://graph.facebok.com/id concept via JSON, but I was not able to call or return any information based on the various pieces of code that I found. I am not sure if I am using the JSON function correctly or not.

For instance,

var testlink = "https://graph.facebook.com/"+id+"/&callback=?";
   $.getJSON(testlink,function(json){
   var test;
  $.each(json.data,function(i,fb){
   test="<ul>"+json.name+"</ul>";
   });
});

In this code, I am trying to return a name to a test variable. When I use this in the Google Chrome extension, it just returns a blank page.

Alternatively, I'm also trying to use the Facebook Javascript SDK in my Google Chrome extension, but I'm not sure which site I should use when registering for the API key.

+3
2

, OAuth API, FB. , FB api, , , , api.

- , javascript Facebook, ! http://developers.facebook.com/tools/console/

+2

, . , :

$.getJSON("http://graph.facebook.com/prettyklicks/feed?limit=15&callback=?", function(json){console.log(json);});

Firefox. Chrome , FF JSON. JSON, - , :

$.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?tags=cat&tagmode=any&format=json&jsoncallback=?", function(data) {console.log(data);});

. , fb. , , , , .

0

Source: https://habr.com/ru/post/1788899/


All Articles