[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Search Netscape History



This is a simple script to search the Netscape History file.  It won't
parse the data associated with the URLs.  The Netscape::History module does
that, but I don't think it works anymore.  Seems the format changed.
Regardless, pass in some text, and it will search for that text in the URLs
in your History file.

I got tired of doing text searches in BBEdit through the file when I
couldn't remember a URL that I had recently gone to.  You may have to
adjust $file to find the right location of the history file, depending on
what version of Netscape you have installed.

#!perl -wl
use DB_File;
use Mac::Files;
use strict;
my($file, $user, %db, $string);

$user = "Chris Nandor";

$string = MacPerl::Ask('Whatcha want?');

$file = FindFolder(kOnSystemDisk, kPreferencesFolderType) .
    ":Netscape Users:$user:Netscape History";

tie %db, 'DB_File', $file, O_RDONLY, 0644 or die $!;

while (my($k, $v) = each %db) {
    print $k if $k =~ /\Q$string/i;
}

print "Done.";
__END__

--
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])

===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org