User Tools

Site Tools


web_browsers:firefox:history_stats

Web Browsers - Firefox - History Stats

First we use sqlite3 to parse the Firefox history database and get the last three months, then we remove all the IP addresses and port numbers and finally we sort and count it.

if [[ ! -d ${HOME}/.www ]]; then
mkdir ${HOME}/.www/
fi
 
cp "$(find "${HOME}.mozilla/firefox/" -name "places.sqlite" | head -n 1)" "${HOME}/.www/places.sqlite"
sqlite3 "${HOME}/.www/places.sqlite" "SELECT url FROM moz_places, moz_historyvisits \
                       WHERE moz_places.id = moz_historyvisits.place_id \
                             and visit_date > strftime('%s','now','-3 month')*1000000 ORDER by \
                       visit_date;"  > "${HOME}/.www/urls-unsorted"
sort -u "${HOME}/.www/urls-unsorted" > "${HOME}/.www/urls"
 
awk -F/ '{print $3}' .www/urls | grep -v -E -e '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' -e ':.*' -e '^$' | sed -e 's/www\.//g' |sort | uniq -c | sort -n

Example output:

    383 lowendtalk.com
    534 reddit.com
    569 google.com
    574 github.com
    792 encrypted.google.com
    973 i.imgur.com
   1458 next.duckduckgo.com
   3009 duckduckgo.com
   6459 wiki.int
  12934 management.int
web_browsers/firefox/history_stats.txt · Last modified: 2020/07/15 09:30 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki