0
在Twitter搜索API中,您可以使用每個搜索結果的唯一ID來回復該帖子。Facebook圖表回覆搜索結果
如(PHP):
$twitter_json = file_get_contents("http://search.twitter.com/search.json?q=".$query."&lang=en", true);
$twitter_search_res = json_decode($twitter_json, true);
$id = $twitter_search_res['results'][0]['id'];
echo "<a href = 'https://twitter.com/intent/tweet?in_reply_to={$id}'>";
我怎樣才能回覆後Facebook的圖搜索的回報?
$fb_json = file_get_contents("http://graph.facebook.com/search?q=".$query."", true);
$fb_search_res = json_decode($fb_json, true);
並將結果之一:
array(7) {
["id"]=>
string(31) "100000101152749_627923180554381"
["from"]=>
array(2) {
["name"]=>
string(19) "Jellie Artus Judith"
["id"]=>
string(15) "100000101152749"
}
["message"]=>
string(101) "here comes the most awaited event of our lives. hahaha graduation of Wave95 (expedia)
:) pakaL time.."
["privacy"]=>
array(1) {
["value"]=>
string(0) ""
}
["type"]=>
string(6) "status"
["created_time"]=>
string(24) "2013-04-18T19:18:23+0000"
["updated_time"]=>
string(24) "2013-04-18T19:18:23+0000"
}
我厭倦了使用https://graph.facebook.com/{$fb_result_id}/comments
而是由圖搜索返回的ID似乎並沒有被正確的。我也在'_'處將ID分開,但這兩者都不起作用。
它的意思爲隨機搜索,我只是想知道是否有能力做同樣的事情Twitter允許 – iRector
在你調用facebook搜索API後,你得到的數據,你提取「id」(或我們稱之爲POST_ID)字段,例如,150552388343703_483757795023159,然後你讓HTTP POS T請求https://graph.facebook.com/POST_ID/comments?access_token=USER_ACCESS_TOKEN,發佈數據爲「message = something」 –