Created
October 21, 2012 19:17
-
-
Save ozh/3928158 to your computer and use it in GitHub Desktop.
YOURLS to TweetButton
This file contains 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 characters
javascript:(function(){var d=document,s=d.createElement('script');window.yourls_callback=function(r){if(r.short_url){javascript:window.open('https://twitter.com/intent/tweet?text='+encodeURIComponent(' '+r.short_url+' '+d.title.replace(/^[ ]+|[ ]+$/g, '')),'Tweet','width=400,height=260');}else{alert('An error occured: '+r.message);}};s.src='http://u.vanu.jp/admin/index.php?u='+encodeURIComponent(d.location.href)+'&jsonp=yourls';void(d.body.appendChild(s));})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment