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,'+
(