Skip to content

Instantly share code, notes, and snippets.

@mundoblogger mundoblogger/shorturl_js
Last active Dec 15, 2015

What would you like to do?
Adds Shorturl on blogger
<script type="text/javascript" charset="utf-8" src=" Key"></script>
<script type="text/javascript" charset="utf-8">
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;
document.getElementById("shorturl").innerHTML = "Link: <input type='text' value='" + result['shortUrl'] + "' name='bitlyurl'/>";
BitlyClient.shorten(document.location, 'BitlyCB.myShortenCallback');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.