This project has moved and is read-only. For the latest updates, please go here.

Tweeting Through console application

Nov 25, 2013 at 6:18 AM
Edited Nov 25, 2013 at 7:26 AM

I am developing a console application to update status on twitter. I am using linqtotwitter library for this. I have already successfully implemented it for website. But when I use same credentials(4 keys), it says 'Unable to query twitter'.

I want to schedule this application, which fetches status from database and tweet. It is single user scenario.

My code in Program.cs file
    var auth = new SingleUserAuthorizer
        Credentials = new SingleUserInMemoryCredentials
            ConsumerKey = ConfigurationManager.AppSettings["ConsumerKey"],
            ConsumerSecret = ConfigurationManager.AppSettings["ConsumerSecret"],
            OAuthToken = ConfigurationManager.AppSettings["AccessToken"],
            AccessToken = ConfigurationManager.AppSettings["AccessTokenSecret"]
    var twitterCtx = new TwitterContext(auth);

    var tweet = twitterCtx.UpdateStatus(message);
Need help guys.
Nov 25, 2013 at 3:51 PM

I need more information on the error you're receiving. Do you have the message, stack trace, and possible HTTP status code? Is there an InnerException?

You're using SingleUserInMemoryCredentials a little differently - e.g. it's more common to use TwitterAccessToken and TwitterAccessTokenSecret properties. Here's the docs on that:

Make sure your credentials aren't accidentally backwards.

@JoeMayo on Twitter
Nov 26, 2013 at 6:34 AM
Thanks for your reply.

I modified my credentials. It did work for me.