Application only authentication

May 29, 2013 at 8:08 AM
Hi, can some point me to an example where a visitor to my website could see public feed from any twitter account, and that particular users won't require to supply any credentials.

I want to get the result as was returned earlier in v1 of twitter API by

https://api.twitter.com/1/statuses/user_timeline.rss?screen_name=
Coordinator
May 29, 2013 at 8:50 PM
Hi,

Here's the LINQ to Twitter documentation for the User timeline:

https://linqtotwitter.codeplex.com/wikipage?title=Querying%20the%20User%20Timeline&referringTitle=Making%20Status%20Queries%20and%20Calls

The Twitter API now requires authentication on all API calls.

@JoeMayo
Jun 24, 2013 at 10:10 PM
Is there any sample code showing how to authenticate with Application-only authentication?
Coordinator
Jun 24, 2013 at 10:17 PM
@pmarangoni,

Yes, there's a demo in the downloadable source code, in the OAuthDemos.cs file of the LinqToTwitterDemos project. It looks like this:
        private static void HandleApplicationOnlyAuthentication()
        {
            var auth = new ApplicationOnlyAuthorizer
            {
                Credentials = new InMemoryCredentials
                {
                    ConsumerKey = ConfigurationManager.AppSettings["twitterConsumerKey"],
                    ConsumerSecret = ConfigurationManager.AppSettings["twitterConsumerSecret"]
                }
            };

            auth.Authorize();
            //auth.Invalidate();

            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));
        }
@JoeMayo
Jun 24, 2013 at 10:22 PM
Thanks Joe! I'll give it a try.
Nov 30, 2013 at 8:00 PM
This is a great library. You save my life Joe Mayo. Thank you very much!!
Note: You should put that example on the homepage of the linqtotwitter site. I was looking something like that for hours.