How to add a twitter user to your follow list

by Viper 22. May 2009 05:28

This code snippet will demonstrate how you can add a twitter user to your follow list. This is called adding a user to your friends list.


static void AddToFollow(string userName)
{
 IFluentTwitter ft = FluentTwitter.CreateRequest();
 ft.AuthenticateAs(LOGIN_NAME, PASSWORD);
 ft.Friendships().Befriend(userName);
 var resp = ft.Request();
 if (null != resp)
 {
  TwitterUser user = resp.AsUser();
  if (null != user)
  {
   Console.WriteLine("User {0} added to follow list", user.ScreenName);
  }
 }
}

On successful execution of request, API returns details of the user that you added to your friend list.

Give your advice to big bosses and make money

Views: 1123

Tags: ,

Twitter

Comments

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