In the twitter search API you can use the unique id every search result has to reply to that post.
eg (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}'>";
How can I reply to a post the Facebook graph search returns?
$fb_json = file_get_contents("http://graph.facebook.com/search?q=".$query."", true);
$fb_search_res = json_decode($fb_json, true);
With one of the results being:
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"
}
I tired using https://graph.facebook.com/{$fb_result_id}/comments
but the id returned by the graph search doesn't seem to be the correct one. I also split the id at the '_' and neither of those worked.