Created
May 30, 2010 02:24
-
-
Save jpwatts/418716 to your computer and use it in GitHub Desktop.
Revisions
-
jpwatts revised this gist
Jun 5, 2010 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,12 +1,12 @@ // javascript:(function(){var l=(document.querySelector('[rev~="canonical"]')||document.querySelector('[rel~="alternate"][rel~="short"]')||document.querySelector('[rel~="shortlink"]')||document.querySelector('[rel~="shorturl"]')||document.querySelector('[rel~="alternate"][rel~="shorter"]'));if(l){prompt("Short URL:",l.getAttribute('href'));}else{window.shortUrlBookmarkletCallback=function(bitly){if(bitly.status_code===200){prompt("Bit.ly URL:",bitly.data.url);}else{alert("Bit.ly error:"+bitly.status_txt);}};var s=document.createElement('script');s.type='text/javascript';s.src=('http://api.bit.ly/v3/shorten'+'?longURL='+encodeURIComponent(window.location.href)+'&domain=j.mp'+'&format=json'+'&callback=shortUrlBookmarkletCallback'+'&login=BITLY_USERNAME'+'&apiKey=BITLY_API_KEY');document.querySelector('head').appendChild(s);}})(); (function() { var l = (document.querySelector('[rev~="canonical"]') || document.querySelector('[rel~="alternate"][rel~="short"]') || document.querySelector('[rel~="shortlink"]') || document.querySelector('[rel~="shorturl"]') || document.querySelector('[rel~="alternate"][rel~="shorter"]')); if (l) { prompt("Short URL:", l.getAttribute('href')); } else { window.shortUrlBookmarkletCallback = function(bitly) { if (bitly.status_code === 200) { -
jpwatts revised this gist
Jun 5, 2010 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,9 @@ // javascript:(function(){var l=(document.querySelector('[rev~="canonical"]')||document.querySelector('[rel~="alternate"][rel~="short"]')||document.querySelector('[rel~="shortlink"]')||document.querySelector('[rel~="shorturl"]')||document.querySelector('[rel~="alternate"][rel~="shorter"]'));if(l){prompt("Short URL:",l.href);}else{window.shortUrlBookmarkletCallback=function(bitly){if(bitly.status_code===200){prompt("Bit.ly URL:",bitly.data.url);}else{alert("Bit.ly error:"+bitly.status_txt);}};var s=document.createElement('script');s.type='text/javascript';s.src=('http://api.bit.ly/v3/shorten'+'?longURL='+encodeURIComponent(window.location.href)+'&domain=j.mp'+'&format=json'+'&callback=shortUrlBookmarkletCallback'+'&login=BITLY_USERNAME'+'&apiKey=BITLY_API_KEY');document.querySelector('head').appendChild(s);}})(); (function() { var l = (document.querySelector('[rev~="canonical"]') || document.querySelector('[rel~="alternate"][rel~="short"]') || document.querySelector('[rel~="shortlink"]') || document.querySelector('[rel~="shorturl"]') || document.querySelector('[rel~="alternate"][rel~="shorter"]')); if (l) { prompt("Short URL:", l.href); -
jpwatts revised this gist
May 30, 2010 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,4 @@ // javascript:(function(){var l=(document.querySelector('[rev~="canonical"]')||document.querySelector('[rel~="alternate"][rel~="short"]')||document.querySelector('[rel~="shortlink"]')||document.querySelector('[rel~="alternate"][rel~="shorter"]'));if(l){prompt("Short URL:",l.href);}else{window.shortUrlBookmarkletCallback=function(bitly){if(bitly.status_code===200){prompt("Bit.ly URL:",bitly.data.url);}else{alert("Bit.ly error:"+bitly.status_txt);}};var s=document.createElement('script');s.type='text/javascript';s.src=('http://api.bit.ly/v3/shorten'+'?longURL='+encodeURIComponent(window.location.href)+'&domain=j.mp'+'&format=json'+'&callback=shortUrlBookmarkletCallback'+'&login=BITLY_USERNAME'+'&apiKey=BITLY_API_KEY');document.querySelector('head').appendChild(s);}})(); (function() { var l = (document.querySelector('[rev~="canonical"]') || document.querySelector('[rel~="alternate"][rel~="short"]') -
jpwatts renamed this gist
May 30, 2010 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
jpwatts created this gist
May 30, 2010 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ (function() { var l = (document.querySelector('[rev~="canonical"]') || document.querySelector('[rel~="alternate"][rel~="short"]') || document.querySelector('[rel~="shortlink"]') || document.querySelector('[rel~="alternate"][rel~="shorter"]')); if (l) { prompt("Short URL:", l.href); } else { window.shortUrlBookmarkletCallback = function(bitly) { if (bitly.status_code === 200) { prompt("Bit.ly URL:", bitly.data.url); } else { alert("Bit.ly error: " + bitly.status_txt); } }; var s = document.createElement('script'); s.type = 'text/javascript'; s.src = ('http://api.bit.ly/v3/shorten' + '?longURL=' + encodeURIComponent(window.location.href) + '&domain=j.mp' + '&format=json' + '&callback=shortUrlBookmarkletCallback' + '&login=BITLY_USERNAME' + '&apiKey=BITLY_API_KEY'); document.querySelector('head').appendChild(s); } })();