Platinum Partner
dotnet,asp.net,twitter

Twitter from ASP.NET

Got this question yesterday and since it looked interesting to me I decided to dig into it.

Any chance we can get a simple tutorial on using Twitter frame work in asp.net
Grabbing the stuff and posting to a site etc.

We will have to go at this in steps but I think this is something we can deal with easily.  Besides, I’m using twitter myself and having this code might just be useful.

While we could roll our own library, there is really no need to.  Several libraries have already been written.  Not that it’s all that hard, we’re just talking some HTTP request.

Here are some you might want to try:

For our samples we will be using Twitterizer because when I asked, that’s what the guy who asked the question is trying to use.

The first thing you’ll want to do is go to the twitterizer link above and download the Twitterizer.DLL

Next, you’ll want to create an asp.net web project and add a reference to the twitterizer.DLL

To make sure everything is working correctly, we are going to go into the codebehind and hard code the following:

  • Log into the account
  • Post a message

 

protected void Page_Load(object sender, EventArgs e)
{
Twitterizer.Framework.Twitter twit =
new Twitterizer.Framework.Twitter
("Dave_Bush", "password");
twit.Status.Update("Test message from " +
"twitterizer. See the code in " +
"tomorrow's post.");
}

Obviously, I’m not going to show you my password in the code.  But if you go look at my twitter messages, you WILL see that message.

Next post about twitter, we’ll submit a message from a web form.

 

Published at DZone with permission of {{ articles[0].authors[0].realName }}, DZone MVB. (source)

Opinions expressed by DZone contributors are their own.

{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}