Sure is. Ecco un esempio:
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("\nQuery: {0}\n", srch.SearchMetaData.Query);
srch.Statuses.ForEach(entry =>
Console.WriteLine(
"ID: {0, -15}, Source: {1}\nContent: {2}\n",
entry.StatusID, entry.Source, entry.Text));
Ci sono esempi in esecuzione nel progetto LinqToTwitterDemo del codice sorgente scaricabile. Il file Program.cs ha un'opzione solo per l'applicazione. C'è anche un file OAuthDemos.cs che ha un esempio.
fonte
2013-05-05 23:46:41
Oh, e stavo cercando solo OAout esempi :(Grazie mille! Questo funziona per me! –
Joe, Auth.IsAuthorized restituisce sempre false anche quando ha chiamato Authorize() e sta restituendo correttamente TwitterData. Conosco correttamente quando l'app è autorizzata. Ho riscontrato che ottengo eccezioni non rilevate in Linq2Twitter se chiamo Authorize() su ogni chiamata effettuata – DevDave
Ho appena risposto a una domanda simile qui: http://stackoverflow.com/questions/16520278/linqtotwitter-isauthorized-sempre-rendimenti-falsi-per-applicationonlyauthorizer/16528192 # 16528192 –