How to add new twitter status message update using REST API

by Viper 22. May 2009 11:47

In this code sample I will demonstrate how you can use twitter API to add a new status message to your account. In terms of Twitter API it is termed as Update of your status.


static void AddStausMessage(string msg)
{
 IFluentTwitter ft = FluentTwitter.CreateRequest();
 ft.AuthenticateAs(LOGIN_NAME, PASSWORD);
 ft.Statuses().Update(msg).AsJson();
 var resp = ft.Request();
 if (null != resp)
 {
  var status = resp.AsStatus();
  if (null != status)
  {
   Console.WriteLine("Status Id: {0}",status.Id);
   Console.WriteLine("Message: {0}", status.Text);
  }
 }
}

When API executes successfully it returns status object in response. I tested this method using this call AddStausMessage("Publishing more code samples showing to use Twitter API");. You can see this on my profile on twitter by clicking HERE

Give your advice to big bosses and make money

Views: 3726

Tags: ,

Twitter

Comments

8/15/2009 12:26:29 AM #

Piaget Limelight Tonneau Ladies

Tried to autotranslate you site not understand the writing any hope deutsch version?

Piaget Limelight Tonneau Ladies United States

8/18/2009 7:54:03 PM #

Nike Womens Imara Soar

Would you like to post a guest post on my blog?

Nike Womens Imara Soar United States

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading



Powered by BlogEngine.NET 1.5.1.7
Theme by Naveen Kohli

By Categories