0

我们是 Twitter Api / Twitterizer 的新手。

我们使用了 twitter 搜索,然后根据 Twitter 帮助编辑了 URL,一切都很好(http://search.twitter.com/search.json?q=manchester%20airport%20delay)。

我们现在想做的是在我们的 C# 代码中使用 Twitterizer 应用相同的搜索。

谁能指出我们正确的方向。

4

2 回答 2

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);
    }
}
于 2011-11-07T15:53:51.113 回答
0

与其自己构建它,不如查看http://linqtotwitter.codeplex.com/上的 LINQ to Twitter 项目

于 2011-11-07T16:29:16.273 回答