The best (but still not perfect) way to do this is pretty easy, really:
http://ip-address.domaintools.com/myip.xmlso connect to ip-address.domaintools.com port 80, send the following:
GET /myip.xml HTTP/1.1 $+ $crlf $+
host: ip-address.domaintools.com $+ $crlf $+ $crlf
then store all returned data, test the return value of $regex(isp,%data,/$\<isp\>([^<]*)\<\/isp\>^/) (if the return value is 0 then return because otherwise the user will end up with an ugly error message)... then to retrieve the ISP: $regml(isp,1)
edit: this is an example using their free "myip" xml API... to run a query on any IP you'll need to find some other service because this will only work for the IP that the script is running on...