Git Product home page Git Product logo

firefox-places's Introduction

firefox-places

Firefox stores data about browsing history and bookmarks in a Places database. That database is in a file named places.sqlite in the profile1 folder. The export_firefox_places.py tool queries that SQLite2 database and produces a set of output files. It uses the sqlite33 module in the Python Standard Library to do so.

This command-line tool is not meant to be a general-purpose utility. It serves a specific purpose for the author. Nonetheless, it may also serve as an example for others who want to extract a different set of data from their Places database.

For exploring the Places database, and trying different queries, check out Datasette or the DB Browser for SQLite.

Input

It is probably safer to make a copy of the places.sqlite file, when Firefox is not running, and work with that when running this tool.

Output

The following files are produced:

prefix-bookmarks.csv - A listing of parent_path, title, and url in text/csv format.

prefix-bookmarks.html - A html file with links to each bookmark url.

prefix-frecency.csv - A listing of url, title, and frecency4 in text/csv format.

prefix-github-links.html - A html file listing bookmarks where the url points to a GitHub page. This is optional (-g switch).

prefix-history.csv - A listing of url, title, host, visit_count, frecency, and visit_date in text/csv format.

prefix-recent-links.html - A html file listing the "Top 100 Recent/Frequent Links."

Command-Line Usage

usage: export_firefox_data.py [-h] [-p OUTPUT_PREFIX] [-g] places_file

Extracts information from a Firefox places.sqlite file.

positional arguments:
  places_file           Path to the places.sqlite file.

optional arguments:
  -h, --help            show this help message and exit
  -p OUTPUT_PREFIX, --output-prefix OUTPUT_PREFIX
                        Name of prefix for output files. Default is 'places'.
  -g, --do-github       Include an output file listing bookmarks for github
                        URLs.

Additional

There is also a tool named check_html_output.py in this repository. It was used to verify that the generated HTML files are parsable.

Reference

Footnotes

  1. Firefox - Profiles

  2. SQLite, SQLite As An Application File Format

  3. Python - sqlite3 DB-API 2.0 interface for SQLite databases

  4. Firefox - Frecency

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.