New Feature in the TinyUrl Creator Firefox Extension

Posted by Jeremy Gillick on 14 Jul 2008 11:46 am in Extensions

Along with upgrading all my extensions to work in Firefox 3 I also added a new feature to the TinyUrl creator extension: Link Preview.

Now the extension will find all links which have a tinyurl.com address and add a tooltip to tell you what the actual URL is. Simply hover your mouse over the link for a moment and the tooltip will appear with the full URL. Here’s an example:

TinyUrl Creator with Link Preview

I can’t actually take full credit for this idea, last month my friend Stephanie Trimble suggested it over twitter. Thanks Stephanie for the idea!

I also plan to add support for other URL shrinking services in this feature. Please post a comment here with your favorite URL shrinking service so I can be sure to add it to the list.

You can install the extension from this page: http://mozmonkey.com

As always, I really appreciate the support of my users. Thanks.

5 Responses

  1. Jay Says:

    July 14th, 2008 at 12:29 pm

    Hi Jeremy. I’m on the bit.ly team. Of course I’d love to see support for bit.ly in your next rev. If there’s anything you need, let us know. @bitly

  2. Tim Says:

    July 16th, 2008 at 1:48 pm

    J-dogg,

    I’m curious how you did this. Does TinyURL have a real API, or are you scraping the preview page, or doing just a header request? I’d like to get something similar on our forums, as TinyURL and its ilk are so often used to dupe user into going to phishing sites.

  3. Jeremy Gillick Says:

    July 16th, 2008 at 3:09 pm

    Yes, TinyUrl has a really simple API which returns the short URL. As an example, load this url into your browser:
    http://tinyurl.com/api-create.php?url=http://blog.mozmonkey.com

    Here’s my code that does the URL conversion for all the services the extension supports:
    http://bit.ly/1WMrE4

    The code you’re looking for is in the “tinyurl : {” section.

  4. Jeremy Gillick Says:

    July 16th, 2008 at 3:13 pm

    Hey Tim,

    I just realized that I didn’t completely understand your question.

    I use the API to get the short URL, but unfortunately TinyUrl doesn’t have an API to preview it. Even so, I don’t need to do any screen scraping to get it. I setup a simple HTTP request to load the URL and tell it to not follow redirects. Then when it returns I can see where it was going to redirect to.

    So in this code:
    http://bit.ly/1WMrE4

    The “expand : function(url, callback){” function does the work. This is Firefox specific code, but an engineer might be able to get something out of it.

  5. Tim Says:

    July 17th, 2008 at 5:11 pm

    Useful stuff, Jeremy, thanks!

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.