Saturday, 14 July 2012

Create Google Short URLs without the Toolbar

Learn how to use Goo.gl, Google’s new URL shortening service, to shrink web page URLs on the fly without the Toolbar.



Goo.gl is a new URL shortening service from Google but unlike bit.ly or tinyURL, goo.gl cannot be used as a stand-alone service for shrinking URLs of web pages.
That means you can cannot create short URLs on-demand – you either need to install the Google Toolbar or, if you have a blog, you can integrate FeedBurner with Twitterand it will automatically create Google short links for all your new posts (not the old content).

Shorten URLs using goo.gl

There’s however a new extension that you may use to create Goo.gl short URLs for the web page you are currently viewing inside Chrome without requiring the toolbar. Or, if you are using a browser other than Chrome, you can use this online service to shrink the URL of any web page using goo.gl.
Internally, this extension (source) sends a POST request to goo.gl/api with the user-agent parameter set to toolbar@google.com and gets back the Google short URL in JSON. It would be awesome if the developer can convert this extension into abookmarklet.
function shortify(url)
 {
  var auth_token = getUrlShorteningRequestParams(url);
  var urlEscaped = escape(url).replace(/\+/g,"%2B");

  xmlhttp.open("POST", "http://goo.gl/api/url?
     user=toolbar@google.com&url=" + urlEscaped
     + "&auth_token=" + auth_token, false);
  xmlhttp.onload = xmlhttpLoad;
  xmlhttp.send(null);
}

0 comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...
Powered by Blogger.