作者aditionality (@#$%^&*()_)
看板Ajax
标题[问题] FB 透过 post_id取得内容
时间Tue Feb 3 19:52:45 2015
不好意思,因刚接触程式不久,研究好久都测不出来,所以还请各位协助,谢谢。
因网页需求要可透过FB分享内容,并取得内容显示在自己画面上。
想说用fb.ui('feed')得到post_id,再用fb.api('{post_id}')抓内容显示,
但现在会出现错误,
Unsupported get request. Please read the Graph API documentation.
不知道要怎样做才可以透过post_id得到分享的内容呢?
不好意思,附上程式码,谢谢了。
function showStream(){
FB.ui(
{
method: 'feed',
name: 'Facebook Dialogs',
link: '
http://www.google.com',
picture: '',
caption: '千年之约',
description: '赖'
},
function(response) {
if (response && response.post_id) {
get_fb(response.post_id);
}
}
);
}
function get_fb(pid){
spid = "/"+pid
FB.api(
spid,
function (response) {
if (response) {
id = response.id;
document.getElementById('userid').innerHTML =
response.error.message;
}
}
);
}
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 61.219.179.207
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Ajax/M.1422964368.A.AC3.html
1F:→ MangoTW: 你的FB API怎麽下的? 02/04 03:03
※ 编辑: aditionality (114.44.172.49), 02/04/2015 07:40:41
3F:→ doomdied: obj-id贴框框内按Get Comments,这类似你要的吗 ? 02/09 16:56