2011-11-06 156 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之类的图书馆。你的回答似乎并不特别有用。 –