Search code examples
c#.nettwittertwitter-oauthtwitterizer

Help Getting Started with Twitter/OAuth


I'm trying to get up to speed on programming Twitter but am having trouble finding the information I need.

My needs are very modest, I just want to automate posting tweets to several of my own Twitter accounts. I've already registered my application and have my ConsumerKey and ConsumerSecret keys.

I've been toying with Twitterizer 2. Much more than I need, I'm sure. But it should work okay. My questions are:

  1. The Twitterizer examples also require AccessToken and AccessTokenSecret keys. I think GetRequestToken() is used for this but can find no example. How do I obtain these others keys, and do I have to obtain them with each request or is it a one-time deal?

  2. The docs also discuss having the user access Twitter to log in and approve access to their account. I'm the only one using the software and all accounts will belong to me. Can anyone tell me if I can bypass having to bring up the login page in the browser, and if so, how?


Solution

  • If you are only needing to access the accounts that own the application, you can login to dev.twitter.com and copy/paste the access token for that account.

    If you need to access multiple accounts (as it sounds), then you will need to go through the authorization process ONCE with each account. You can do this as part of your application, or as a separate process. The important part is that the user who controls the account grants access to the consumer (aka application) and that you save the access token that is provided at the end of the process.

    After that, if you wish to store the access tokens in a flat file, database, or configuration, that is up to you. Keep in mind that if any one else gets the consumer token and access token, they will have full run of your account through the API, so they should be fairly well guarded.

    (FYI, I'm the author of Twitterizer)