• Programming

    Posted on May 7th, 2009

    Written by Emad Ibrahim

    Tags

    , , , , ,

    Shortening URLs with bit.ly’s API in .NET

    Shortening URLs with bit.ly’s API in .NET

    I previously wrote about shortening URLs with TinyURL’s API but my new favorite URL shortener is http://bit.ly and it also has a great API that you can use from within your .net code.  I just recently used in my twitter contest website – tweetastica. The code is also very simple.  I didn’t add all the [...]

  • Uncategorized

    Posted on April 15th, 2008

    Written by Emad Ibrahim

    Tags

    , , ,

    Shortening URLs Using TinyUrl API in .net

    Here is a quick method to shorten URLs using the TinyUrl API in .net – C# and VB C# public static string MakeTinyUrl(string Url) { try { if (Url.Length <= 30) { return Url; } if (!Url.ToLower().StartsWith(“http”) && !Url.ToLower().StartsWith(“ftp”)) { Url = “http://” + Url; } var request = WebRequest.Create(“http://tinyurl.com/api-create.php?url=” + Url); var res = [...]