[問題] FB 透過 post_id取得內容
不好意思,因剛接觸程式不久,研究好久都測不出來,所以還請各位協助,謝謝。
因網頁需求要可透過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://www.ptt.cc/bbs/Ajax/M.1422964368.A.AC3.html
→
02/04 03:03, , 1F
02/04 03:03, 1F
※ 編輯: aditionality (114.44.172.49), 02/04/2015 07:40:41
→
02/09 16:55, , 2F
02/09 16:55, 2F
→
02/09 16:56, , 3F
02/09 16:56, 3F
Ajax 近期熱門文章
PTT數位生活區 即時熱門文章