[問題] FB 透過 post_id取得內容

看板Ajax作者 (@#$%^&*()_)時間10年前 (2015/02/03 19:52), 10年前編輯推噓0(003)
留言3則, 2人參與, 最新討論串1/1
不好意思,因剛接觸程式不久,研究好久都測不出來,所以還請各位協助,謝謝。 因網頁需求要可透過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
你的FB API怎麼下的?
02/04 03:03, 1F
※ 編輯: aditionality (114.44.172.49), 02/04/2015 07:40:41


02/09 16:56, , 3F
obj-id貼框框內按Get Comments,這類似你要的嗎 ?
02/09 16:56, 3F
文章代碼(AID): #1KqBQGh3 (Ajax)
文章代碼(AID): #1KqBQGh3 (Ajax)