…is really not simple as the actual history file (history.dat) is encoded using the MORK format which is very tough to parse.
The MORK format was invented ages ago by David McCusker and he explained his rationale on his website but the relevant pages seem to have disappeared…
Fortunately, it is possible to export history.dat to a text file but this is a manual process.
One first possibility is to export all URLs which have been accessed from Firefox itself. To do that:
- Install the Enhanced History Manager extension for Firefox
- Restart the browser for the extension to take effect
- Open the History Manager Sidebar (with Ctrl+Shift+H)
- Click on Sorted By and choose None
- Click on the first URL and select all the rest with Ctrl+A
- Copy all the URLs at the same time to the clipboard with Ctrl+C
- Paste into a decent text editor
Unfortunately, we only get the URLs. To get more information, we can use a perl script written by Jamie Zawinski.
- Get mork.pl from Jamie’s website
- Execute
perl mork.pl history.dat > history.txt
and history.txt will contain lines like
1078333826 1 http://www.jwz.org/hacks/
where the first number is a ctime (number of seconds since Jan 1 1970 GMT) and the second number is how many times this URL was visited.
I use this command to know what are the websites I regulary visit:
cat history.txt |
awk ‘{ if ($3 ~ /^http/) print $2 “\t” $3 }’ |
sort -nr |
head -20
and here is the result:
618 https://www.noulakaz.net/
488 http://www.liverpoolfc.tv/
371 https://www.noulakaz.net/…
202 http://www1.koptalkinsider.com/forums/…
184 https://www.noulakaz.net/…
178 http://www.google.com/
121 https://www.noulakaz.net/…
96 http://mail.google.com/mail/html/loading.html
68 http://mail.google.com/mail/…
60 http://mail.google.com/mail/…
29 https://www.noulakaz.net/…
25 https://www.noulakaz.net/…
21 https://www.noulakaz.net/…
19 https://www.noulakaz.net/…
18 https://www.noulakaz.net/…
17 http://www.macosxhints.com/…
16 http://www.apple.com/
13 http://www.macosxhints.com/…
12 http://www.macosxhints.com/…
12 http://mail.google.com/mail/…
I’ve simplified the URLs for security purposes (I presume :-) ).
I can conclude that I am a big fan of (i) my weblog, (ii) Liverpool FC, (iii) Google and (iv) Apple…
Leave a Reply