// ==UserScript== // @name FrontEndBook.com Twitter Enhancer // @namespace frontendbook_twitter_enhancer // @description Autolinks hashtags in messages and makes them searchable by clicking on // @include http://twitter.com/* // @include https://twitter.com/* // ==/UserScript== var script = document.createElement('script'); script.src = 'http://jquery.com/src/jquery-latest.js'; script.type = 'text/javascript'; document.getElementsByTagName('head')[0].appendChild(script); function _wait() { if(typeof unsafeWindow.jQuery == 'undefined') { window.setTimeout(_wait,100); } else { $ = unsafeWindow.jQuery; onjQueryLoaded(); } } _wait(); var hashtag_pattern = /#([^ ]+)/g; function onjQueryLoaded() { $('span.entry-content').each(function(){ elm = $(this); this.innerHTML = this.innerHTML.replace(/#([^ ]+)/g, '#$1'); }); $("a.frontendbook_twitter_enhancer_hashtag").click(function(){ query = $(this).text(); id = "search_result_" + new Date().getTime(); $(this).parent().append("
' + this.created_at + ' ' + this.text + '