Bit.ly for EE

Handy little module that enables you to use the URL shortering service bit.ly on any URL on the fly in your templates. It also includes caching so that the bit.ly API is only contacted once for each unique URL.

Usage example (here we use {comment_url_title_auto_path} as URL inside an {exp:channel:entries} tag):

<a href="{exp:bitly bitly_login='YOUR_BITLY_LOGIN' bitly_api_key='YOUR_BITLY_API_KEY' url='{comment_url_title_auto_path}'}">Tweet this URL</a>

Note: you can also add your bit.ly login to two global variables calledwoo_bitly_login and woo_bitly_api_key to use these everywhere. Doing this the code you use in your template will simply be:

{exp:bitly url='http://verylongurl.com/please_bitly_fy_me.html'}

Note that your host must support file_open to the bit.ly API for this module to work. If you’re just getting the same old URLs back this might be the problem - you can contact your host to fix this or try to add “php_flag allow_url_fopen On” in your .htaccess file.

Addon resources

Download latest release (.zip)