2011-11-06 48 views

回答

0

搜索與Twitterizer是非常直接的,因爲沒有要求授權(甚至接受)。

下面是一個代碼示例,用於執行您鏈接到並循環搜索結果的搜索。

TwitterResponse<TwitterSearchResultCollection> searchResponse = TwitterSearch.Search("manchester airport delay"); 

// You should check that the request was successfull. If not, log/display/handle it. 
if (searchResponse.Result != RequestResult.Success) 
{ 
    // An example method call 
    LogAndDisplayError(searchResponse.ErrorMessage); 
} 
else 
{ 
    // The ResponseObject property will be a TwitterSearchResultCollection 
    // You can bind many controls' datasource directly to the ResponseObject 
    foreach (TwitterSearchResult result in searchResponse.ResponseObject) 
    { 
     // Which means each result will be a TwitterSearchResult 
     DisplayResult(result); 
    } 
} 
+0

上面我得到這個錯誤時要採取看看LINQ到Twitter項目運行代碼時:異常詳細信息:System.Exception的:無法轉換或從System.Double轉換爲Twitterizer.TwitterSearchResultCollection。 – RRG

+0

我相信這個錯誤已被糾正。你能從github獲得最新的代碼,然後再試一次嗎?如果繼續,請將此報告爲新的錯誤。 –

+0

嗨Ricky, 該錯誤似乎已得到修復。 – PerryW

0

而不是自己構建它,你可能想在http://linqtotwitter.codeplex.com/

+0

他並沒有打算自己建造,他打算使用Linq2Twitter之類的圖書館。你的回答似乎並不特別有用。 –