You might want to include that you'll need to sign up for an API key at https://extreme-ip-lookup.com.
You'll also have to change line 56 to something like this to include your key in the call:
$json = file_get_contents("http://extreme-ip-lookup.com/json/" . $ip . "?key=MyAPIKey");
The API key is free with the caveat of you only being able to use it for one site and only with 20 request/minute, which is quite low for a mid-traffic website.
I'd advise anyone that doesn't want to pay to only lookup an IP once and store the location data.
If you get any requests from a previous stored IP you can grab the location data locally and don't need to do any API call.