BitlyHelper class

Simple class for shortening URI's using your own Bit.ly API Key/username:


var helper = new BitlyHelper("MYBITLYAPIKEY", "MYBITLYUSERNAME");
helper.Shorten("http://phoney.codeplex.com", (result, error) =>
  {
    if (error != null)
    {
      MessageBox.Show(string.Concat("Error Shortening Url: ", error.Message));
    }
    else
    { 
      MessageBox.Show(result);
    }
  });

// OR

BitlyHelper.ShortenUrl("MYBITLYAPIKEY", "MYBITLYUSERNAME", "http://phoney.codeplex.com", (result, error) =>
  {
    if (error != null)
    {
      MessageBox.Show(string.Concat("Error Shortening Url: ", error.Message));
    }
    else
    { 
      MessageBox.Show(result);
    }
  });

Last edited Mar 5, 2011 at 7:35 AM by TheADOGuy, version 1

Comments

No comments yet.