Skip to content

Instantly share code, notes, and snippets.

@brockboland
Created July 12, 2012 00:27
Show Gist options
  • Save brockboland/3094686 to your computer and use it in GitHub Desktop.
Save brockboland/3094686 to your computer and use it in GitHub Desktop.
Simple "Tweet this page" bookmarklet Javascript
javascript: var D=550, A=450, C=screen.height, B=screen.width, H=Math.round((B/2)-(D/2)), G=0, F=document, t=encodeURIComponent(F.title), u=encodeURIComponent(F.location); if(C>A) {G=Math.round((C/2)-(A/2));} window.open('http://twitter.com/intent/tweet?text=' + t + '&url=' + u,'','left='+H+',top='+G+',width='+D+',height='+A+',personalbar=0,toolbar=0,scrollbars=1,resizable=1');
@brockboland
Copy link
Author

Partly based on no-longer-functional code from an old blog post: https://dev.twitter.com/docs/share-bookmarklet

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