Sure is. Here's an example:
var auth = new ApplicationOnlyAuthorizer
{
CredentialStore = new InMemoryCredentialStore()
{
ConsumerKey = "twitterConsumerKey",
ConsumerSecret = "twitterConsumerSecret"
}
};
await auth.AuthorizeAsync();
var twitterCtx = new TwitterContext(auth);
var srch =
await
(from search in twitterCtx.Search
where search.Type == SearchType.Search &&
search.Query == "LINQ to Twitter"
select search)
.SingleOrDefaultAsync();
Console.WriteLine("
Query: {0}
", srch.SearchMetaData.Query);
srch.Statuses.ForEach(entry =>
Console.WriteLine(
"ID: {0, -15}, Source: {1}
Content: {2}
",
entry.StatusID, entry.Source, entry.Text));
There are running examples in the LinqToTwitterDemo project of the downloadable source code. The Program.cs file has an option for Application Only. There's also an OAuthDemos.cs file that has an example.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…