Webページの選択箇所をtweetするscriptlet

まず間違いなく車輪の再発明だと思うけど晒す。

javascript:(function(){var%20q=(document.all)?document.selection.createRange().text:(window.getSelection()+'');url_next='http://twitter.com/home/?status='+encodeURIComponent(q)+'%20'+encodeURIComponent(document.title)+'%20'+encodeURIComponent(location.href);location.href=url_next})();