選択文字列を Twitter の投稿画面に遷移するブックマークレット

Twitter に移動するのですぐ投稿できます

画像を追加したければクリップボードにコピーしておいて貼り付ければ追加できます
▼ URL ありバージョン
▼ URL なしバージョン


選択文字列を取り出すコードはわりと有名なブックマークレット用のコードです。誰でも転用できます。
▼ ブックマークレット登録可能な HTML
ブックマークレット => <a href="javascript:var%20d=document,w=window,enc=encodeURIComponent,e=w.getSelection,k=d.getSelection,x=d.selection,s=(e?e():(k)?k():(x?x.createRange().text:0)),s2=((s.toString()=='')?s:(enc(s))),f='https://twitter.com/intent/tweet',l=d.location,p='?text='+s2+'&url='+enc(l),u=f+p;try{if(!/^(.*.)?tumblrzzz[^.]*$/.test(l.host))throw(0);tstbklt();}catch(z){a%20=function(){if(!w.open(u))l.href=u;};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else%20a();}void(0)" onclick=" 
		alert('ブックマークバーまたは、お気に入りバーにドラッグドロップが簡単です'); 
		if (window.navigator.appName.toLowerCase().indexOf('microsoft') > -1) { 
			event.returnValue = false; 
		} 
		event.preventDefault(); 
		event.stopPropagation();
	">選択文字でTwitter投稿</a>


ソースコード

▼ URL ありバージョン
javascript:var d=document,w=window,enc=encodeURIComponent,e=w.getSelection,k=d.getSelection,x=d.selection,s=(e?e():(k)?k():(x?x.createRange().text:0)),s2=((s.toString()=='')?s:(enc(s))),f='https://twitter.com/intent/tweet',l=d.location,p='?text='+s2+'&url='+enc(l),u=f+p;try{if(!/^(.*.)?tumblrzzz[^.]*$/.test(l.host))throw(0);tstbklt();}catch(z){a =function(){if(!w.open(u))l.href=u;};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else a();}void(0)

▼ URL なしバージョン
javascript:var d=document,w=window,enc=encodeURIComponent,e=w.getSelection,k=d.getSelection,x=d.selection,s=(e?e():(k)?k():(x?x.createRange().text:0)),s2=((s.toString()=='')?s:(enc(s))),f='https://twitter.com/intent/tweet',l=d.location,p='?text='+s2,u=f+p;try{if(!/^(.*.)?tumblrzzz[^.]*$/.test(l.host))throw(0);tstbklt();}catch(z){a =function(){if(!w.open(u))l.href=u;};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else a();}void(0)