Facebook嵌入了页面帖子

时间:2013-12-23 17:21:35

标签: javascript facebook facebook-graph-api embed

我已经编写了一个代码,用于通过Graph API从Facebook页面获取帖子ID。并且页面共享或喜欢的帖子会显示为无效帖子

function fbfeeds(data) {
  var entries = data.data || [];
  var html = ['<div class="fbfeed">'];
  for (var i = 0; i < entries.length; i++) {
    var entry = entries[i];
    var pid = entry.id;
    var postid = pid.split("_");
    html.push('<div class="fb-post" data-href="https://www.facebook.com/permalink.php?story_fbid=' + postid[1] + '&amp;id=' + postid[0] + '" data-width="750"><div class="fb-xfbml-parse-ignore"><a href="https://www.facebook.com/permalink.php?story_fbid=' + postid[0] + '&amp;id=' + postid[0] + '">Innlegg</a> av <a href="https://www.facebook.com/pages/{page_name]/{page_id}">page_id</a>.</div></div>');
    html.push('<br>');
  }
  html.push('</div>');
  document.getElementById('fbfeed').innerHTML = html.join('');
}

The page with the code

如何在帖子中显示喜欢和分享? 无论作者是否有嵌入帖子的通用代码?

0 个答案:

没有答案