run |
(function rec(win){
var cb = '__', dic = {};
while(win[cb]) cb += Math.random() * 1e5 | 0;
win[cb] = function(o){ try{
var e = dic[o.fields.key[0].value];
e.innerHTML += ' => '+ (e.title = o.dapper.status === 'OK'
? o.fields.url[0].value.replace(/\s/g, '')
: 'ERROR');
} catch(_){}};
var e, m, s, f, i = 0, r = /^http:\/\/tinyurl\.com\/(\w+)/;
with(win.document) for(; e = links[i++];) if((m = r.exec(e.href))){
dic[m[1]] = e;
s = document.createElement('script');
s.src = ['http://www.dapper.net/transform.php?dappName=XpandTinyURL',
'&extraArg_callbackFunctionWrapper=', cb,
'&transformer=JSON&v_key=', m[1]].join('');
body.appendChild(s);
}
f = win.frames;
for(i = 0; e = f[i++];) rec(e);
f = win.document.getElementsByTagName('iframe');
for(i = 0; e = f[i++];) rec(e.contentWindow);
}(self))
|