Download & Extend

Integrate with Shorten URLs module

Project:Twitter
Version:6.x-3.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

I've just released the Shorten URLs module, which makes it very easy to create short URLs from any of at least 14 services. Shorten URLs takes care of any problems that could arise if getting a short URL is taking too long or if the service is unavailable.

I think Twitter would benefit from integrating with Shorten URLs instead of handling its own URL shortening at TinyURL. This would give users more flexibility in how to handle URL shortening, take some of the burden off the shoulders of Twitter's maintainers, and provide even shorter URLs in many cases than TinyURL can.

To produce a short URL, you just need to call shorten_shorten($url_to_be_shortened) and Shorten URLs will take care of the rest. This would replace calls to twitter_shorten_url($url) in the current API.

Thoughts?

Comments

#1

While I like this idea, personally I would not want to see a basic module like Twitter start adding dependencies. Maybe someone can code the integration of your module with Twitter and make it so your module extends the Twitter module without making it a dependency (i.e module_exists() hook)

#2

Yeah, it wouldn't be a dependency. There are three lines in twitter.module at the moment which allow a single, site-specific module to add a custom way to shorten URLs. Presumably, those would be replaced with this:

<?php
 
if (module_exists('shorten')) {
    return
shorten_shorten($url);
  }
?>

#3

FYI, shorten_shorten() is now shorten_url() in the 1.1 release and later.

#4

Status:active» fixed

According to the 6.x-2.6 release node, this has been fixed! Thanks.

#5

Status:fixed» closed (fixed)

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

#6

Version:6.x-2.x-dev» 6.x-3.x-dev
Status:closed (fixed)» patch (to be ported)

Re-opening as this somehow didn't make it into the 3.x branch.

#7

Status:patch (to be ported)» fixed

this is now in the 3.x branch. thanks!

#8

Status:fixed» closed (fixed)

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

#9

I'm not sure if this only got fixed in the dev branch because I couldn't figure out how to get it to stop using TinyUrl and use the Shorten module instead. I was able to hack it by changing line 172 in twitter_post.module from

//$replacements['!tinyurl'] = twitter_shorten_url(url('node/'. $node->nid, array('absolute' => TRUE)));

to
$replacements['!tinyurl'] = shorten_url(url('node/'. $node->nid, array('absolute' => TRUE)));

It's working great for me now.
nobody click here