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.0.0/build/yui/yui-min.js"></script>YUI({
//Last Gallery Build of this module
gallery: 'gallery-2012.11.09-01-41'
}).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.
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info