DMT bookmarks-sqlite
These scripts:
- read Firefox-sqlite-bookmarks
- don't export private or internal bookmarks
- and output bookmarks (properly organized in subfolders) as webpage
The problem
Exporting the old Firefox-hmtl-bookmarks as webpage (of my taste) was an easy job.
But the task was getting harder with bookmarks stored in a sqlite-database (places.sqlite).
bookmarks-sqlite: Files
check-running-gui.sh
The bash-shellscript check-running-gui.sh
is called by bookmarks-export.sh
.
This allows to distinguish the kind of environment: graphical userinterface (GUI) or command line (shell).
bookmarks-export.sh
The bash-shellscript bookmarks-export.sh
checks the calling environment and executes the main script (with some parameters).
These are the parameters:
- PHP_SCRIPT: path and name to
bookmarks_sqlite.php
- SOURCE_FILE: path and name to the
places.sqlite
-database inside the Firefox-profil-directory - TARGET_FILE: path and name to the own bookmark-webpage in the local file space
- TEMPLATE_FILE: path and name to the template webpage with copying the contents of navigation and css
- REMOVEWHITESPACE: 0/1-values if whitespace should be removed in the output file
bookmarks_sqlite.php
bookmarks_sqlite.php
is a wrapper with some settings and call of the programm routines.
bookmarks_sqlite_functions.php
bookmarks_sqlite_functions.php
contains the needed php-functions.
Of course the information in the paragraph REPLACEMENTS should be adapted to your template-webpage.
Tips
While testing the script should be called via command line.
This will show all output (incl. errors) of all components.
Before first trials i recommend making a safety backup of a existing output-target-file.
bookmarks_sqlite.php
knows some constants for omitting bookmark-folders not to be exported:
- INTERNAL_FLAG: "private" flag of "internal" bookmark-folders
- DEFAULT_TEMP: "private" flag of temporary bookmark-folders
- DEFAULT_TEMP_SUBMENUE: flag of folder-default-names when storing multiple bookmarks
The processed bookmarks are temporarily stored in a sqlite-database, where they can easily be inspected.
Download
- check-running-gui.sh: bash-shell-script for distinguishing the call by GUI or shell
- bookmarks-export.sh: bash-shell-script to be called
- bookmarks_sqlite.php: php-script for extracting and exporting the sqlite-bookmarks
- bookmarks_sqlite_functions.php: php-script with the needed functions