Revision: 24640
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at March 7, 2010 06:15 by stephanepericat
Initial Code
/**
* author : Stephane P. Pericat
* date : 2010-03-02
*/
var link = "http://www.snipplr.com/";
var slink = null;
var short = new Request.JSONP({
url: 'http://api.bit.ly/shorten',
callbackKey: 'callback',
onSuccess: function (result) {
slink = result['results'][''+link+'']['shortUrl'];
console.log(slink)
},
data: {
version: '2.0.1',
longUrl: link,
login: 'username',
apiKey: 'R_dd761983d39ab216af226a19756496d3',
format: 'json'
}
}).send();
Initial URL
Initial Description
A simple way to send an ajax request to the Bit.ly API and return the shortened url.
Initial Title
Connect to Bit.ly API with MooTools
Initial Tags
Initial Language
JavaScript