(function(){ var h,x,b; if(location.href.match(/^https?:\/\/(m\.|explore\.)?twitter\.com\/([0-9A-Z_a-z]+)\/status/)){ h="RT+@"+RegExp.$2+":+"; }else{ alert("Not in a tweet page!"); return; } x=(document.getElementsByTagName("body"))[0].innerHTML.match(/(.+?)<\/span>/ig); if(x && x.length==1){ b=RegExp.$1; b=b.replace(/@\1<\/a>/ig,function(s,p){return "@"+p;}); b=b.replace(/]*?class="?hashtag"?[^>]*?>#(.+?)<\/a>/ig,function(s,p){return "#"+p;}); b=b.replace(/.+?<\/a>/ig,function(s,p){return p;}); location.href="http://twitter.com/?status="+h+encodeURIComponent(b); }else{ alert("Can not extract the tweet!"); } })();