New class Net_Geo
| From: | Graeme Merrall | Date: | Tue, 29 Jan 2002 23:45:09 +0000 |
| Subject: | New class Net_Geo | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-4281@lists.php.net to get a copy of this message | ||
Hi.
I've knocked up a class which is PEAR compatible called Net_Geo. This is a
basic port of existing Java and Perl classes from caida.org.
Net_Geo obtains geographical information based on IP address, host name or
Autonomous System (AS) number. From this input, various information is
returned including latitude and longitude ranging in granularity from
Country to City depending on what's in the NetGeo database.
You can check it out at http://inetix.com.au/php/test_netgeo.php
I've found that even though you can feed in domain names, the NetGeo server
does not always return a positive result whereas an IP number always works
correctly so the test form converts to an IP before querying. I've also
included a link to Map Quest for fun. Ouput formatted using Frederic's
class Var_Dump class :)
The caching is rather simple so any advice there would be appreciated. IIRC
last time I tried the Cache/Function.php I could not use it inside a class.
I'd love to see it go into PEAR is possible.
Cheers,
Graeme