2LeggedSpider

Another URL Shortener and it is from Google

Posted in google, technology by Sumit Thomas on December 18, 2009

[tweetmeme style=”compact”]Twitter has opened the way for a new stream of online service – URL Shortening! and cousin, the business is booming! 🙂

Goo.gl is Google’s version of URL Shortening service. Unlike its counterpart tinyurl.com or bit.ly, Goo.gl is not a stand alone tool to generate short URLs. For now, the only way you can shorten a URL using Goo.gl is by using the Google Toolbar or if you have a Feedburner account, integrate your Feedburner feeds with your Twitter account.

If you are a Google Chrome user, you can install this extension which lets you use Goo.gl without the toolbar. But it works only in the Google Chrome Beta version though.

Facebook has its own URL Shortener as well fb.me. I am not sure when it started but I’ve seen couple of tweets with fb.me URL. It will be very interesting to know the long term objective of Google and FB and what it will do to the existing players.

Tagged with: , ,

Enabling jQuery Intellisense in VS 2008

Posted in jquery by Sumit Thomas on December 18, 2009

[tweetmeme style=”compact”]This post is for all my friends who still don’t have jQuery intellisense enabled in their VS 2008. This came as a shock to my when one my colleagues asked me how come your VS has jQuery intellisense and mine does not?

So here is how you get it….

1) Download and install VS 2008 SP1 from here

2) Download and install the VS 2008 Patch from here. This patch helps VS 2008 check for -vsdoc.js files when a JavaScript file is in use and drive the JS intellisense engine.

VSDOC.js

jquery-1.3.2-vsdoc.js file is available in the Scripts folder of your ASP.NET MVC Web Application by default. If you don’t find it there then download it from here

That should do it!

Tagged with: , ,

Generating a Shorter URL using bit.ly API and jQuery

Posted in AJAX, jquery by Sumit Thomas on December 18, 2009

[tweetmeme style=”compact”]Here is a simple jQuery script to generate shorter URL using the bit.ly API.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>URL Shortening</title>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>

    <script type="text/javascript">
        $(document).ready(function() {
            $("#btnShort").click(function() {
                var longUrl = $("#longUrl").val();
                var shortUrl = $("#shortUrl");
                shortUrl.html("Loading...");
                var params = {
                    version: "2.0.1",
                    longUrl: longUrl,
                    login: "bitlyapidemo",
                    apiKey: "R_0da49e0a9118ff35f52f629d2d71bf07"
                };
 
                $.getJSON("http://api.bit.ly/shorten",
                { version: params.version, longUrl: params.longUrl, login: params.login, apiKey: params.apiKey },
                function(data) {
                    shortUrl.html(data.results[longUrl].shortUrl);
                });
            });
        });
 
    </script>

</head>
<body>
    <input type="text" id="longUrl" /><input type="button" id="btnShort" value="Shorten!" />
    <br />
    <div id="shortUrl" />
</body>
</html>

URL Shortening

You can go through the bit.ly API documentation and try out the remaining methods as well.

Tagged with: , ,