Cool techie hacks always get me excited.
A friend of mine added a widget on her Blogspot blog today that shows the list of visitors coming to her blog, and then using IP geolocation to figure out the location of the person. So when I visit her blog now, the right hand panel screams out “Philadelphia, Pennsylvania visited … ”
Somehow that seems like intruding into my privacy, I mean… I should be able to stalk women without them having to know that I am stalking them. Where’s the justice in this world? ;-)
Anyway, I really don’t mind people knowing that I visited their blog, but still it’s not nice to be told that you’re being watched, and worse still to share the information in public. What’s between you and me, should remain between you and me.
It’s surprising that WordPress.com doesn’t share IP logs with blog owners. You might call it a privacy issue, blah blah blah, but a self-hosted WordPress blog would probably give that information, so it’s not a big deal. So I decided to do this small hack in order to get an access log.
So here’s full disclosure, the End Reader Licence Agreement: BY VISITING THIS BLOG, YOU AGREE TO BE TRACKED, WATCHED, AND PERHAPS STALKED.
Too late, you don’t have a “Decline” button.
So how did I do this: WordPress has a widget called “Text”, which basically allows for HTML too. Simple, just fill the widget with
<img src="<outside-url-that-you-can-track>" alt="" /> . After that, everytime you get a visitor, his browser will try to get that image, and the IP address will get logged on your external server. I’m using CMI’s server, and the image file is a PHP script that does the logging.
Also, since all my friends are distributed around the globe, IP geolocation should quite precisely tell me who visited when. :P By storing the referrer I can also figure out which post you read.
As I said, I know you don’t like to be told that you’re been watched, so I’ll also tell you how to get around my logging system. If you don’t want me to know when you’re visiting (maybe you’re a woman stalking me? omg, this is so fantastic!), you can use adblock to block “http://www.cmi.ac.in/~arnold/image.php”