Dav Yaginuma;
Husband, Father, Hacker, Burner, Thinker, Maker;
San Francisco.

Twitter Updates

    follow me on Twitter
    Dav's currently-reading book recommendations, reviews, favorite quotes, book clubs, book trivia, book lists
    Blog powered by TypePad

    « Iraq on the Record Database | Main | shipyard dorkbot »

    TrackBack

    TrackBack URL for this entry:
    http://www.typepad.com/services/trackback/6a00d834581abf69e20115710e5182970c

    Listed below are links to weblogs that reference a sorry saga of stupidity and solutions started by spam:

    Comments

    Feed You can follow this conversation by subscribing to the comment feed for this post.

    Mie

    I'm relieved it went well. I saw you go through all that although I didn't really know what was going on. I'm so proud of you!

    mfrumin

    you said you need to "store the data in a hash table where the key is the requested url and the value is an array of all the different unique refers for that post"

    my $d = {};
    while() {
    my ($req_url, $refer) = parse_line($_);
    if(!exists($d->{$req_url})) {
    $d->{$req_url} = {};
    }
    $d->{$req_url}->{$refer} = 1;
    }

    foreach my $k (keys %$d) {
    print "URL: $k\n";
    foreach my $r (keys %{$d->{$k}}) {
    print "\tREFERER: $r\n";
    }
    }

    this could definitely be done in many fewer lines, but i thought i'd be more expressive just for illustration's sake.

    obviously i'm working at home and procrastinating the shit out of my friday afternoon.

    Verify your Comment

    Previewing your Comment

    This is only a preview. Your comment has not yet been posted.

    Working...
    Your comment could not be posted. Error type:
    Your comment has been posted. Post another comment

    The letters and numbers you entered did not match the image. Please try again.

    As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

    Having trouble reading this image? View an alternate.

    Working...

    Post a comment