const Twit = 'http://twitter.com/', Icon = Twit +'favicon.ico', PageMax = 40, Style = , LongURLAPI = 'http://api.longurl.org/v1/expand?format=json&url=', ReLnk = /^\s*https?:/, ReImg = /\.(?:jpe?g|gif|png)$/i; function fixLinks(q){ q.find('li a').each(expand) } function expand(){ with(this) if(ReLnk.test(innerHTML)) jQuery.getJSON( LongURLAPI + href, function({long_url, title}){ if(long_url){ var dlu = decodeURIComponent(long_url); innerHTML = (title ? title +' ('+ dlu +')' : (ReImg.test(long_url) ? '' : dlu)); }}); } CmdUtils.CreateCommand({ name: 'reversed-timeline', synonyms: ['rvtl'], icon: Icon, takes: {page: { _name: 'twitter_pages', default: function(p) CmdUtils.makeSugg((p || PageMax) +''), suggest: function(txt, htm, cb, sx)( sx ? [] : [this.default((txt & 63) % (PageMax + 1))]), }}, description: 'Opens '+ 'your timeline'.link(Twit) +' in reverse order', help: 'Powered by '+ 'longurl'.link('http://longurl.org/'), execute: function({text: p}){ var htm = 'data:text/html,'+ ({this.name +' '+ p} + Style), tab = (Application.activeWindow .open(Utils.url(htm.replace(/\s*([<>])\s{0,}/g, '$1')))); tab.events.addListener('load', function(){ for(var {document: {body}} = tab; p; --p) +function(u){ var ol = (jQuery(
    {p}
+'') .appendTo(body)); jQuery.get(u, function(htm){ var ls = jQuery('div.s + ul > li, #timeline > li', htm); fixLinks(ol.append(Array.reverse(ls))); }); }(Twit +'home?page='+ p); }); }, preview: function(pbl, {text: p}){ pbl.innerHTML = this.description +' from page '+ p +'.'; }, previewDelay: 0, author: 'satyr'.link('http://ubigist.appjet.net/?o=satyr'), license: 'MIT', });