Hi,

Is it possible to request specific urls? For example, we have bit.ly pro so have our own url domain. I would like to see tt.lk/1234 generated for node 1234 etc.

Thanks,
Paul.

Comments

icecreamyou’s picture

Status: Active » Fixed

Not quite, sorry. The API doesn't support custom URLs right now. But if you just want short URLs that match a pattern, you could easily write a custom service for Shorten URLs to do that, e.g.:

/**
 * Implementation of hook_shorten_service().
 */
function MYMODULE_shorten_service() {
if (variable_get('shorten_bitly_login', '') && variable_get('shorten_bitly_key', '')) {
  return array('MYSERVICE' => 'http://api.bit.ly/v3/shorten?format=txt&domain=j.mp&login='.
    variable_get('shorten_bitly_login', '') .'&apiKey='.
    '&custom-name='. MYMODULE_get_custom_name() .
    variable_get('shorten_bitly_key', '') .'&longUrl='
  );
}

However, bit.ly's API doesn't support custom URLs like that. You can only do it through the UI.

One possible Drupal-based alternative is LittlURL.

Also, you should be using Shorten URLs 1.12, not 1.9.

techypaul’s picture

Hi ICY,

Thanks very much for your assistance, would be a nice feature :). I'll take a look at the other options (oh, and will upgrade :)).

Thanks for the time,

Paul.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.