The Real URL

[UPDATED on April 21st, 2009 to reflect the JSON/P additions. Since it’s <24 hours after the initial release, I hope it won’t cause anyone problems.]

The Real URL began as a joke – after discovering, while working on another project, over 80 URL shortening services, I figured there must be room for a service that un-shortens all these URLs. (The web is overflowing with hype and blog posts/articles complaining about it just add to the noise, so it’s better to make your point by building something. My favorite example is the Twittering Office Chair).

Turns out there are already several out there: (eg, trueurl) but I built it anyway, since I had a slightly different approach in mind. The Real URL is meant to be used as a web service rather than on its own. It returns the “real” URL in either raw text, JSON or JSONP format – examples and details are on the homepage. (I added JSON mostly for JSONP, per Chris’ comment – admittedly I didn’t even know it existed ;) This enables cross site JS requests which might actually make The Real URL useful.

While I do want The Real URL to be solid and reliable in the long term, I don’t want to spend much time/money keeping it up. It’s a sustainability issue – building a system that will work reliably over a long time while requiring minimal care and resources. I made a few design decisions to that end:

  • Keep it simple (always a good idea). Real URL does only one thing and is accessible in only one way (the homepage demo uses XHR to access the service, to keep it so). It now supports text/JSON/JSONP, but it’s just the same output formatted differently. Sometimes you give up some elegance to make the product useful. As in the following item:
  • Deploy with Google’s App Engine. Initially it was nice, super-minimal Sinatra code. Unfortunately Google App Engine doesn’t support Ruby yet and there’s no service that offers comparable cost/stability ratio, so I rewrote in slightly less minimal Python for GAE.
  • Use App Engine’s domain (therealurl.appspot.com). Buying a domain and keeping it renewed isn’t a big deal, but it still requires some attention – especially if you happen to hit a nice domain name which people try to grab or piggyback on. Sticking with appspot.domain minimizes this issue. (if the need rises I might add a “real” domain later on, but in any case therealurl.appspot.com will remain active)

If you find a use for The Real URL this or have an idea for one, please comment here or email me at niryariv@gmail.com. Let the street find its own uses etc ;)

Advertisements

29 thoughts on “The Real URL

  1. @Chris – thanks! I added these now.

    (Initially I chose not to support JSON in order to keep it minimal, but JSONP changes the whole picture. Now that it’s possible to use The Real URL remotely from JS, it might actually prove somewhat useful :)

    Reply
  2. Pingback: List of URL Shortening Sites « plaintext

  3. Pingback: JSONP, Quickly « plaintext

  4. Pingback: UnShorten Wordpress Plugin Uses TheRealURL « plaintext

  5. Nice stuff, been looking out for a good unshortener.
    One small request could you also return the content-type, content-length headers of the unshortened in the response json? That would be damn cool.

    Reply
    • Hi E.,

      Basically every URL shortener that uses HTTP redirect (and that would be pretty much all of them) is supported. That should include all the sites listed in both of these URLs, and many more – including sites that aren’t necessarily URL shorteners but do URL redirects.

      Reply
  6. Hello,

    Quick question:

    Do I understand it correct that the requests to unshorten the urls go through Google? Translating into Google adds the request (and all info about the requester) to its collection of user data?

    Anyway to avoid this?

    Thank you

    Reply
    • Hi Kate,

      The only connection to Google is the fact the app runs on their App Engine. To the best of my knowledge Google doesn’t collect data from requests to TheRealURL and even if they wanted to, I don’t see how they could considering that requests don’t contain any cookie information that could attach them to a particular user.

      In short, I think there’s very low chance of Google collecting TheRealURL request data. The app itself doesn’t collect user data at all.

      Reply
  7. Awesome!

    I’m going to migrate my chrome url expanding extension to use your service. The service I am using is very slow from time to time so this looks like a great improvement!

    Reply
    • Awesome! Would love to see this, esp. since I find myself using Chrome more and more :)

      If there’s anything I can help with just let me know.

      Reply
      • Yup, installed it, works great.

        Two ideas for possible improvements, if you’re interested:

        1. TheRealURL also provides you some page info (eg, page title) if you want to display that somewhere (perhaps on the status bar?)

        2. I notice some of the short URLs (eg 4sq.com) don’t get expanded. I assume you’re checking against an internal list of shortening services? That’s a tricky issue, since on one hand you don’t want to hit the server for every URL and on the other the number of shortener services keeps growing. One solution I was thinking of is running a regex on every URL to determine if it’s likely to be a shortened one: for example, URLs that follow a format of “http://x.y/z” (ie, only 1 dot in the domain part, no slashes in the path) where x and z are smaller than, say, 8 characters.

  8. I have been using TheRealURL Add-on for Firefox and it is excellent.

    I recently installed the add-on for Thunderbird as well and have discovered a big problem with it. I open messages in their own windows and TheRealURL does NOT give any right click option for TheRealURL within the message window. This is a big frustration in that the extension is worthless for how I use Thunderbird.

    To check on this I opened a message “In A New Tab” instead and there TheRealURL extension worked just fine. So the problem seems to be only with messages opened in their own windows as opposed to in new tabs. This doesn’t sound like a major programming problem, and I hope that it can be fixed without too much trouble.

    Thanks.

    Reply
    • Hi Jon,

      Unfortunately at the moment I can’t really support the Thunderbird version – I have little time to work on TheRealURL currently and have very little experience with Thunderbird.

      However, the code is open so if you have the skills or can find someone who does please feel free to go ahead and change it (if you do, please share the fix with me so I can add it for everyone)

      Thanks,
      Nir

      Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s