[development] Geo-IP Modifications to 'watchdog' and 'statistics'
listout at accidentaltechie.org
Tue Apr 18 10:18:11 UTC 2006
Last night I wrapped up a few changes to my copy of 'watchdog.module' and
'statistics.module' to add a graphic country flag and country, city,
latitude and longitude.
In case anyone would like to spruce up their 'details' pages, as you see
from either the watchdog entries 'details' link or the statistics module's
'details' links, then you might find this useful.
(I often would copy an IP from a log entry and then paste it somewhere else
to get more data. Now I don't need to do that.)
A short post with some images will help explain the small addition, which
you can read here <http://accidentaltechie.org/dru/?q=node/38>
The changes are:
- add 3 utility functions to watchdog module, to curl the hostname IP data;
- add a new table row to the watchdog output;
- add a new table row to the statistics output
The functions are surely not as compact as they could be, and there could be
some more specific error checking about the results. (No error is
destructive, and 'curlerrno' is reported back when encountered, so it's
pretty graceful even with junk.)
Although not web-configurable, there is a boolean 'switch' in the functions
to include or exclude Latitude and Longitude data. (Commented.) As is, they
_do_ include this data.
You can download a text file which includes a description and copy-paste
code at the above URL.
Feel free to experiment (I use the hostip.info HTTP service, but others
could be substituted, with modifications to the "split()" functions to break
apart the curled result.
Anyway, my first "Thanks for your help as I've come along."
Have at it.
More information about the development