Dav Glass![]()
Featured ItemModule deals with the bit.ly api for shortening or expanding URL's.
To use the bit.ly module, you must have a bit.ly username and apiKey. If you do not have an apiKey, sign up for a bitly account and go to your Account page to get your apiKey.
This module supports the following bit.ly API's at version 2.0.1
More information on the bit.ly API can be found here
<script src="http://yui.yahooapis.com/3.1.0/build/yui/yui-min.js"></script>YUI({
//Last Gallery Build of this module
gallery: 'gallery-2009.11.09-19'
}).use('gallery-bitly', function(Y) {
var b = new Y.bitly({
//You must get your own to use this. See module description
username: 'bitlyapidemo',
key: 'R_0da49e0a9118ff35f52f629d2d71bf07'
});
//Event based
b.on('shorten', console.log);
b.on('expand', console.log);
b.shorten('http://blog.davglass.com/');
//Callback based
b.shorten('http://blog.davglass.com/', function(e) {
b.expandByURL(e.shortUrl, console.log);
b.infoByHash(e.hash, console.info);
b.statsByHash(e.hash, console.log);
});
});No forum posts for this module.
© 2010 YUI Library - Site Credits