Simon Wistow > File-Mork-0.3 > File::Mork

Download:
File-Mork-0.3.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 0.3   Source  

NAME ^

File::Mork - a module to read Mozilla URL history files

SYNOPSIS ^

    my $mork = File::Mork->new($filename, verbose => 1) 
        || die $File::Mork::ERROR."\n";


    foreach my $entry ($mork->entries) {
        while (my($key,$val) = each %$entry) {
            printf ("%14s = %s\n", $key, $val);
        }
    }

DESCRIPTION ^

This is a module that can read the Mozilla URL history file -- normally $HOME/.mozilla/default/*.slt/history.dat -- and extract the id, url, name, hostname, first visted dat, last visited date and visit count.

To find your history file it might be worth using Mozilla::Backup which has some platform-independent code for finding the profiles of various Mozilla-isms (including Firefox, Camino, K-Meleon, etc.).

METHODS ^

new <file> [opts]

Takes a filename and parses that file.

Returns undef on error, setting $File::Mork::Error.

Takes an optional hash of options

parse <file>

Internal method to parse the file. Obviously.

entries

Return a list of File::Mork::Entry objects sorted by LastVisitDate.

error <message>

Internal method to set the internal error message

debug <message> <priority>

Internal method to print out a debug message if it's a higher priority than the the current verbosity level.

THE UGLY TRUTH LAID BARE ^

Extracted from mork.pl

In Netscape Navigator 1.0 through 4.0, the history.db file was just a Berkeley DBM file. You could trivially bind to it from Perl, and pull out the URLs and last-access time. In Mozilla, this has been replaced with a "Mork" database for which no tools exist.

Let me make it clear that McCusker is a complete barking lunatic. This is just about the stupidest file format I've ever seen.

       http://www.mozilla.org/mailnews/arch/mork/primer.txt
       http://jwz.livejournal.com/312657.html
       http://www.jwz.org/doc/mailsum.html
       http://bugzilla.mozilla.org/show_bug.cgi?id=241438

In brief, let's count its sins:

Pure comedy.

AUTHOR ^

Module-ised by Simon Wistow <simon@thegestalt.org>

based on

    http://www.jwz.org/hacks/mork.pl

Created: 3-Mar-2004 by Jamie Zawinski, Anonymous, and Jacob Post.

COPYRIGHT ^

Copyright © 2004 Jamie Zawinski <jwz@jwz.org>

LICENSE ^

Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. No representations are made about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.

BUGS ^

Might be a bit memory heavy? Could do with an iterator interface.

Can't write Mork dbs.

SEE ALSO ^

http://www.livejournal.com/users/jwz/312657.html

http://www.erys.org/resume/netscape/mork/jwz.html

NAME ^

File::Mork::Entry - an single entry in a mork DB

METHODS ^

All methods except new take an optional argument to set them.

new <%opts>

blesses %opts into the class File::Mork::Entry

ID

The internal id of the entry

URL

The url visited

NAME

The name of the url visited

Hostname

The hostname of the url visited

FirstVisitDate

The first time this url was visited as a ctime

LastVisitDate

The last time this url was visited as a ctime

Hidden

Whether this URL is hidden from the history list or not

VisitCount

The number of times this url has been visited

ByteOrder

The byte order - this is associated with ID number 1.

syntax highlighting: