2011-06-24 64 views
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(); 

有沒有其他方法可以做到這一點?

回答

0

我認爲不再有歷史可用。查看其他谷歌匹配this link。這可能是一個古老的問題,但是這個概念的含義是:幾天後就不再有搜索歷史了,而且據我所知,這並不是twitter所特有的。

相關問題