StatusNet bit.ly URL shortening plugin updated

I’ve pulled in some fixes from one of my old experimental branches which gets StatusNet‘s bit.ly URL shortener plugin working again.

Some while ago, bit.ly changed to requiring an API key for all shortening requests, which broke our old BitlyUrlPlugin.

The updated version now in master & 0.9.x branches allows setting sitewide bit.ly credentials, either through the addPlugin() parameters or in the admin panels on the site:

If no credentials are set up, then bit.ly isn’t offered as a shortening service to end-users; if they are set up then the global keys are used for all bit.ly requests. Settings in the admin panel will override those in the addPlugin() parameters; this allows setting a default for a big hosted site farm like *.status.net, while individual sites can customize their settings to make use of the statistic tracking features or custom domains that bit.ly pro accounts offer.

It would be nice to further add a per-user override, but a little refactoring on the ‘other settings’ panel is needed to keep everything together in one place.

This isn’t available on status.net hosted sites just yet, but it should be coming soon!