Вот еще один способ сделать это с помощью PHP и fOpen.
<?php
// Define your output file name and your search query
$output = 'result.txt';
$search = 'great';
write_twitter_to_file($output, $search);
/*
* Writes Json responses from twitter API to a file output.
*
* @param $output: The name of the file that contains the output
* @param $search: The search term query to use in the Twitter API
*/
function write_twitter_to_file($output, $search) {
$search = urlencode($search);
$url = 'http://search.twitter.com/search.json?q=' . $search;
$handle = fopen($url, "r");
if ($handle) {
while (($buffer = fgets($handle, 4096)) !== false) {
file_put_contents($output, $buffer, FILE_APPEND);
echo "Output has been saved to file<br/>";
}
if (!feof($handle)) {
echo "Error: unexpected fgets() fail\n";
}
fclose($handle);
}
}
?>