Skip to content

Instantly share code, notes, and snippets.

@mundoblogger
mundoblogger / shorturl_js
Last active December 15, 2015 23:39
Adds Shorturl on blogger
<script type="text/javascript" charset="utf-8" src="http://bit.ly/javascript-api.js?version=latest&login=bitlyUsername&apiKey=bitlyAPI Key"></script>
<script type="text/javascript" charset="utf-8">
BitlyClient.addPageLoadEvent(function(){
BitlyCB.myShortenCallback = function(data) {
// this is how to get a result of shortening a single url
var result;
for (var r in data.results) {
result = data.results[r];
result['longUrl'] = r;
break;