The rise of Twitter and other microblogging systems with constrained character counts has led to renewed interest in Web services that shorten URLs. Support for these services is often integrated into desktop client applications so that users can take advantage of the functionality without having to open a browser window.
Most desktop clients, however, make users jump through a few extra hoops in order to shorten a URL. For example, Seesmic makes users click a toolbar button and then paste the link into a popup dialog. Gwibber, my microblogging client for Linux, avoids the extra step by automatically shortening URLs when they are pasted directly into the message textbox. This seems to be a popular feature and I’ve been asked to explain how it works on several occasions. In this tutorial, I’ll show you how to intercept and manipulate text as it is being pasted into a GTK+ textbox.
Originally Syndicated via RSS from Ars Technica













