New Series: Use the .NET TweetSharp Library to Integrate with Twitter via OAuth

This is the first post on a new series I will be posting on integrating TweetSharp into your .NET applications.  It will also show you how to use OAuth, as all the examples will be connecting to Twitter via OAuth.

So what is TweetSharp?  It’s a .NET library that hooks 100% into the Twitter API.  The project is constantly updated as bugs and enhancements are pushed out to the Twitter API.  I have been using TweetSharp in an application I wrote 6 months ago and it has worked flawless.

I will start by explaining what this series will cover.  In the first post I will go over how you actually create an application on your Twitter account.  By the end we will be grabbing our security tokens via OAuth and posting status updates to Twitter via OAuth.

Our first step in setting up our little application will be to register a new app with Twitter.  In order to use the OAuth features, you must start by doing this.  So let’s get started.

Log into your Twitter account via the web.  Once you are logged in point your browser to http://twitter.com/apps where you will see a listing of your current apps, or a link to register a new application.

series1-1

Click on the link to register a new application.  From this page you can start to enter in the details of your new application including an icon and the name of your app.  Our most important areas of the signup for this post are to set the application type to “Browser”, the default access type to “Read & Write” and the Callback URL.  The Callback URL is where Twitter where send the user to after they grant your application access to their account via OAuth.  We will discuss the code on this page in another post.  It’s also important to note that this URL needs to be publicly available.  For now set this to the full URL of your callback page.

Once you submit this page you will be taken to the main screen for your new application.  Take note of all the information returned on this page, as it will be critical later on!  Both the consumer key and the consumer secret fields will be used in our code to work with OAuth.

So now that your new app is set up, you can read a little more about TweetSharp and go ahead and download the library.  Our next post will explain how to authorize a user’s Twitter account to use your application via OAuth.

Comments

comments powered by Disqus