#!/usr/bin/perl -w
#
# $Revision: 1.2 $ $Date: 2009/09/25 17:19:41 $
# $Source: /home/vogelke/notebook/2008/0813/firefox-sqlite/RCS/ffhistory,v $
# $Host: sys7.com $
# $UUID: 89c8dee5-b83b-3719-ac8f-89a2ed1583da $
#
#<ffhistory: print dumped Firefox history in readable form.

use POSIX qw(strftime);
use strict;
my ($d, $url, $date);

while (<>) {
    chomp;

    # Read entries that look like this:
    #   1218648093058315|http://developer.mozilla.org/en/docs/PRTime
    ($d, $url) = split (/\|/, $_);

    # Keep only the first 10 digits from the time.
    $date = strftime("%Y-%m-%d %T", localtime(substr($d, 0, 10)));
    print "$date $url\n";
}

exit (0);
