0
我想要獲取用戶'zapallpeople'的所有推文的json/xml回調或包含標籤'#zapallpeople'的標籤。 我試過搜索api,但它只會返回最近6天內的推文。 http://search.twitter.com/search.atom?q=from:zapallpeople%20OR%20%23zapallpeople如何獲取指定用戶或給定哈希標籤的所有推文?
然後我試着用Streaming API的跟蹤方法使用Phirehose PHP庫來做到這一點,但由於某種原因,這在我們的web服務器上不起作用。 (我得到一個PHP超時錯誤)
<?php
require_once('../lib/Phirehose.php');
/**
* Example of using Phirehose to display a live filtered stream using track words
*/
class FilterTrackConsumer extends Phirehose
{
/**
* Enqueue each status
*
* @param string $status
*/
public function enqueueStatus($status)
{
/*
* In this simple example, we will just display to STDOUT rather than enqueue.
* NOTE: You should NOT be processing tweets at this point in a real application, instead they should be being
* enqueued and processed asyncronously from the collection process.
*/
$data = json_decode($status, true);
if (is_array($data) && isset($data['user']['screen_name'])) {
print $data['user']['screen_name'] . ': ' . urldecode($data['text']) . "\n";
}
}
}
// Start streaming
$sc = new FilterTrackConsumer('username', 'password', Phirehose::METHOD_FILTER);
$sc->setTrack(array('zapallpeople'));
$sc->consume();
有沒有其他方法可以做到這一點?