I wanted to have a shortcut in Safari, which allows me to instantly post the Webpage I am currently browsing to Twitter.
Thanks to the service TwitThis.com and the JavaScript-Code they use, I was able to create just what I desired:
Short “How-to” video
Required JavaScript-Code for the Safari-shortcut
javascript:window.open("http://twitthis.com/twit?url="+encodeURIComponent(location.href)+"&title="+((document.title) ? encodeURIComponent(document.title.replace(/^\s*|\s*$/g,'')) : ""), "TwitThisPop", "width=600, height=600, location, status, scrollbars, resizable");
References used
nice! very nice indeed!