Our users will not want to type in the long URLs that we currently provide for calling a waiter to their table. We'll now look at using the bitly API to create shorter equivalents of the URLs that we've already created. The shorter URLs, which can be typed into address bars (especially on mobile devices) more easily, will then be shown as being associated with the corresponding tables instead of the longer ones we have now.
The premise behind Bitly—and many similar services—is simple. Given a URL of arbitrary length, the service returns a shorter URL of the form bit.ly/XySDj72
. Bitly and similar services normally have very short root domains (bit.ly is five letters), and they simply maintain a database that links the short URLs they create to the longer ones input by the users. Because they use a combination of lower- and uppercase characters as well as digits to create the shortened URLs, there is no shortage of combinations to use, even...