Small is Beautiful: working with short URLs

Post navigation

Today’s world limits our expressions lenght to 140 character. No matter you text SMS or Tweet, you have to fit your sentences based on this restriction. Further to that, nobody has toleration for longer statements. That’s why, text material should be picked and chosen. Herein, some subsdiary materials such as long links would cause to go waste. To sum up, small is beautiful.

Bitly’s blowfish logo stands for url shortening

URL shortening services redirect long urls to shorter one. This kind of urls are friendly for messaging technologies requiring limited number of characters such as sms. Thus, you can append a link into your message and message quota would not be exceeded. Moreover, short urls are memorable. That’s why, referencig short urls are common in hard copied paragraphs such as newspapers or magazines.

What’s more, Bitly and Google are the most common url shortening service providers for end users. Although, web inteface of these service providers are easy to consume, urls should be shorten manuelly. In this post, we will focus on how to consume these services in our programs.

Bitly is dedicated firm for url shortening whereas url shortening is one of the services of Google. This means that Google might terminate url shortening service if the service would not be profitable. Similarly, Google terminatesFreebase or Google Reader in the past. On the other hand, Bitly makes money only on url shortening. That’s why, termination of Bitly’s service would be surprise. Anyhow, we will mention integrating for both Bitly and Google.

No matter which service provider you consume, you need to register you projet and create a key. You should apply following orders to create application keys.

Otherwise, you should visit Bitly Developer Console to consume Bitly’s service. Then you can create your project and key on main page.

The following java code is developed to shorten urls. It consumes both Bitly and Google services. The both services are consumed as REST services. The main difference between accessing Bitly and Google is http methods. Bitly provides to access its service with HTTP GET method whereas Google provides to access the service with HTTP POST method.,

So, the following results are produced when the code run. Now, we can involve shortening url service in our business flows. Fortunately, short urls produced by Bitly and Google are non-temporary. Moreover, we would not consider hash collision. In other words, we can produce unique and everlasting urls.

Finally, Bitly limits to shorten 10k links per month for free accounts wheresas providing larger limits for premium accounts. On the other hand, Google limits to shorten 1M link per days. However, Google restricts to shorten 100 links per 100 seconds. That prevents to shorten bulk links. In contrast, Bitly does not restrict traffic in that way.

As mentioned before, Bitly is dedicated firm for url shortening. That’s why, terminating its services would not be expected. However, there are services shut down by Google before. So, I prefer to consume Bitly’s url shortening service for personal use.