简体   繁体   中英

Twitterizer Search

We are new to Twitter Api / Twitterizer.

We have used the twitter search and then edited the URL as per the Twitter help and everything is fine ( http://search.twitter.com/search.json?q=manchester%20airport%20delay ).

What we would like to do now is apply the same search using Twitterizer in our C# code.

Could anyone point us in the right direction.

Searches with Twitterizer are pretty straight forward, since no authorization is required (or even accepted).

Here is a code sample to perform the search you linked to and looping through the results.

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);
    }
}

与其自行构建,不如看一下http://linqtotwitter.codeplex.com/上的LINQ to Twitter项目。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM