Skip to content

Instantly share code, notes, and snippets.

@ayberk
Forked from JoelBesada/README.md
Last active December 27, 2015 11:49
Show Gist options
  • Save ayberk/7320910 to your computer and use it in GitHub Desktop.
Save ayberk/7320910 to your computer and use it in GitHub Desktop.
var url = document.URL;
javascript:(function(){
//window.twttr=window.twttr||{};
var D=550,A=450,C=screen.height,B=screen.width,H=Math.round((B/2)-(D/2)),G=0,F=document,E;
if(C>A){
G=Math.round((C/2)-(A/2))
}
var win =window.open('http://twitter.com/share','','left='+H+',top='+G+',width='+D+',height='+A+',personalbar=0,toolbar=0,scrollbars=1,resizable=1');
//var win = window.twtter.shareWin;
win.focus();
// If the window opened successfully (e.g: not blocked)
if (win) {
win.onload = function() {//onload can be blocked by the brower
win.getElementById("status").value = url;
};
}
E=F.createElement('script');E.src='http://platform.twitter.com/bookmarklets/share.js?v=1';
F.getElementsByTagName('head')[0].appendChild(E)}());
{
"name": "Share on Twitter with URL",
"description": "A Backtick Hello World example command.",
"icon": "http://icons.backtick.io.s3.amazonaws.com/backtick.png",
"link": "http://backtick.io"
}
@XCMerlin
Copy link

XCMerlin commented Nov 5, 2013

"name": "Example Command",
"description": "A Backtick Hello World example command.",
"icon": "http://icons.backtick.io.s3.amazonaws.com/backtick.png",
"link": "http://backtick.io"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment