Notice, as of Oct 6 2019 this project uses api key authentication method. This is soon being deprecated by Bit.ly in favor of Oauth.
A sample project that uses the bit.ly API to shorten URLs and copy them to the OS clipboard.
This is a small javascript example to show how to create a function that will connect to the bit.ly API and use it to shorten the current web page's url. JQuery is used to aid in cross-site request validation when loading credentials from an external source.
There is also a button used to copy the shortened url to the User's clipboard or one can select the link directly from the form.