Yeah, the IP address detection stopped because the islayer.com web sites went the way of the dodo bird -- and because the iStat Pro widget, by default, uses a URL within that domain for IP address detection. The solution is to use another web site that can display your external IP address when it's accessed. There's a number of such website that can do this for you (
whatismyip.com is one I've used often; even google will tell you
when you ask for it)
It's important to note that iStat wants to hit a URL that will return the IP address of the client (you) in plain text, with no HTTP cruft. The code for this stuff lives within the
iStat Pro.wdgt package, in
scripts/core.js, in the function
getExtIP() (roughly line 243 in the file). This function is as follows:
Code:
function getExtIP(){
ipURL = 'http://whatsmyip.islayer.com/?random='+new Date().getTime();
ipConnection = new XMLHttpRequest();
ipConnection.open("GET",ipURL,true);
ipConnection.onreadystatechange = function() {
if(ipConnection.readyState == 4 && ipConnection.responseText != null && ipConnection.responseText.length > 0) {
extIP = ipConnection.responseText;
if(extIP.length < 20 && ipConnection.status == 200 && extIP.match(/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/)){
e("wide_extip").innerHTML = extIP;
e("tall_extip").innerHTML = extIP;
valid_ip = true;
} else {
valid_ip = false;
e("wide_extip").innerHTML = "Unknown";
e("tall_extip").innerHTML = "Unknown";
}
}
}
ipConnection.send(null);
}
I posted the whole thing for the sake of context and completeness, but the important bit here is the second line: the variable
ipURL. Since whatsmyip.islayer.com no longer exists, we need a new URL to use. It also needs to be a URL that returns the client's IP address in plain text
(this part is implied by code later in the function, specifically, that the IP length be less than 20 chars. Including dots, even if each octet in an IP is 3 digits, that gives a max of 15.)
If you have access to a web server on the public Internet with PHP or similar on it, you can whip up a small utility that, when accessed by an HTTP client, will simply return the client's IP address
(in Apache web servers, I think you could use the value of the REMOTE_ADDR environment variable) For those of us that don't have this luxury -- well, ask google.
I asked google for a
website to return my IP address in plain text. I'm not going to recommend any of the results of that google, because
automated IP lookups may or may not fall within their acceptable use policies, etc.
(In fact, here's such a policy at WhatIsMyIp.com) Once you find a URL that, when accessed, returns your public IP in plain text -- simply use that as the new value for
ipURL on line 244 (or thereabout) in
scripts/core.js. But please respect the usage policies of whatever site you use, as applicable.
Good luck