Ich versuche, Beiträge von Facebook auf meiner Website zu ziehen. Ich habe eine Facebook-App für dasselbe erstellt (https://www.facebook.com/kcm.edu.np/). Code:Facebook App, um Beiträge in der Website nicht funktioniert
$(document).ready(function() {
var accessToken ='975498622499311|eKS53jkWW4F74JEShrDHuJNwOwg';
$.ajax({
url: 'https://graph.facebook.com/v2.5/kcm.edu.np/posts?fields=full_picture,id,is_published,link,story,message,name,updated_time,description,from,source,caption,created_time,permalink_url,type,target&access_token=' + accessToken + '&limit=6',
type: 'GET',
success:function(result){
$("#hidden-next-feed").val(result.paging.next);
$.each(result.data, function(index, value) {
var link;
var imgSrc = '';
var name = '';
var message = '';
if(typeof(value.link) != "undefined" && value.link !== null) {
link = value.link;
} else {
link = value.permalink_url;
}
if(typeof(value.full_picture) != "undefined" && value.full_picture !== null) {
imgSrc = value.full_picture;
}
if(typeof(value.name) != "undefined" && value.name !== null) {
name = value.name;
}
if(typeof(value.message) != "undefined" && value.message !== null) {
message = value.message;
}
$("#facebook-feed").append(
'<div class="grid-item"><a href="'+value.permalink_url+'" target="_blank">'+
'<div class="thumbnail">'+
'<img src="'+imgSrc+'" alt="'+name+'" >'+
'<div class="caption">'+
'<h3>'+name+'</h3>'+
'<p>'+message+'</p>'+
'</div>'+
'</div>'+
'</a></div>'
);
});
$container.masonry('destroy');
$container.imagesLoaded(function(){
$container.masonry({
itemSelector: '.grid-item',
percentPosition: true
});
});
},
error:function() {
$("#facebook-feed").html('Failed To Load Resource');
}
});
});
Problem:
{
"error": {
"message": "Unsupported get request. Object with ID 'kcm.edu.np' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100,
"fbtrace_id": "FsBLqadb5Oz"
}
}
Wie soll ich dieses Problem zu lösen? Jede Hilfe/Vorschläge sind willkommen. Danke im Voraus.
Gehen Sie jetzt zu Facebook und setzen Sie Ihre App geheim. Das App-Geheimnis solltest du als Passwort behandeln und niemanden anzeigen – WizKid