Anatiferous blog | Move every zig.

Meta-Site

Welcome to Anatiferous: Using barnacles to make geese since 1689!

Howdy! This is my (William Reading's) webpage. At the moment, I only have this blog script and my gallery up, but I hope to get more stuff on this page at some point, or so I thought when I created this site years ago. Updates and shiny new copy to eventually go here. If you'd like to contact me to point out that I've done something to break XHTML/CSS standards or heaven forbid--look at my Vita--drop me a line at my e-mail address bill +spam @ [ELEPHANT] aggienerds.org. Simply remove "+spam", the spaces and the pachyderm along with its brackets and that address will reach me. I'm also available on Jabber/GChat/AIM/MSN with the same address above.

2/4/2006

City location information via porn sites

Filed under: — bill @ 6:02 pm

Today, someone sent me a link to a Homemade Datacenter. The pictures are mildly interesting, but what is more so is the banner ad at the bottom. It advertises a popular dating site called “Adult Friend Finder". “So What?", you’re probably asking yourself. Well, what’s interesting is that it seems to be really good at figuring out your location from an IP address.

For example, I’m using Verizon DSL and my IP’s whois information returns Reston, VA. The hostname is “herntx.dsl-w.verizon.net” (probably referring to Hearne, Texas, about 25 miles away). So my guess if I was just trying to figure out where I’m at would be in hearne. The traceroute to home doesn’t reveal anything interesting along the way other than Hearne is probably wired to Dallas. Even so, Adult Friend Finder correctly deduces that I’m in College Station.

Now I have no idea where they get the data, but I figured it would be handy next time I’m travelling. So I wrote a perl scripty to tell me:


#!/bin/perl
use LWP::Simple;
my $locationServer="http://banners.adultfriendfinder.com/piclist";
my $locationData = get($locationServer) or die “Could not retrieve data from server";
$locationData =~ /near (.*?)</

And sure enough, it works:


[bill@ppppowerbook-airport]~$ perl findme.pl
College Station

And for this server:

[bill@aggienerds]~$ perl findme.pl
Dallas

It looks like they also have support for grabbing the state and country, but I’ll need to add another line or two to deal with that. (They display other places with the state and country attached, but not your own.)

Note: You might need to install LWP::Simple with perl -MCPAN -e ‘install LWP::Simple’ using sudo or root to run this:

 

Google
 
Web anatifero.us
aggienerds.org

Powered by WordPress