Hi,
Don’t specify the BaseUrl when instantiating TwitterContext. The one you’re using is for Twitter API v1.0, which is deprecated. TwitterContext will default to the proper BaseUrl for Twitter API v1.1, which is current. Here’s an example of using ApplicationOnlyAuthorizer:
var auth = new ApplicationOnlyAuthorizer
{
Credentials = new InMemoryCredentials
{
ConsumerKey =
ConfigurationManager.AppSettings[“twitterConsumerKey”],
ConsumerSecret =
ConfigurationManager.AppSettings[“twitterConsumerSecret”]
}
};
auth.Authorize();
var twitterCtx = new TwitterContext(auth);
var srch =
(from search in twitterCtx.Search
where search.Type == SearchType.Search &&
search.Query == "LINQ to Twitter"
select search)
.SingleOrDefault();
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));
This demo is part of the downloadable source code in the OAuthDemos.cs file of the LinqToTwitterDemos project.