User:Equazcion/ipinfo.js

if (typeof wgRelevantUserName !== 'undefined' && !isNaN(wgRelevantUserName.substr(0,1))){ var torLinkTitle = 'Check if this IP is a TOR node'; var ipInfoStyle = '"float:right; border:1px solid rgb(47, 111, 171); padding:0 7px 5px 5px; ' +       'margin:10px; "'; var ipInfoField = 'IP info '; var $contentSub = $('.mw-contributions-form'); var torLink = ' (tor check) '; $.get('http://ipinfo.io/' + wgRelevantUserName + '/json', {}, function(r1){       r1 = JSON.stringify(r1);        var ipdata = $.parseJSON(r1);        $contentSub.after(ipInfoField);        var $ipInfo = $('.ipInfo');        $.each(ipdata, function(key, data){ if (key == 'ip') { data += ' ' + torLink } key = key.substr(0,1).toUpperCase + key.slice(1); $ipInfo.append(' ' + key + ':  ' + data + '  '); });   }); }