GithubHelp home page GithubHelp logo

mrhappy / ffbx Goto Github PK

View Code? Open in Web Editor NEW

This project forked from websafe/ffbx

0.0 1.0 0.0 26 KB

Extract Firefox bookmarks from places.sqlite found in user profiles. Returns CSV data containing: timestamp of last modification, profile name, bookmark folder, url, title, tags.

License: GNU General Public License v3.0

Shell 100.00%

ffbx's Introduction

ffbx - Firefox bookmarks extractor

Simple Bash script using sqlite3 for extracting bookmarks from places.sqlite found in Firefox user profiles.

Bookmarks are extracted with:

  • timestamp of last modification,
  • profile name,
  • folder,
  • url,
  • title,
  • tags.

Usage

A simple test without installing:

wget -qO - https://raw.githubusercontent.com/websafe/ffbx/master/ffbx.sh | bash

or:

lynx -dump https://raw.githubusercontent.com/websafe/ffbx/master/ffbx.sh | bash

or:

curl -sS https://raw.githubusercontent.com/websafe/ffbx/master/ffbx.sh | bash

Output bookmarks stored in places.sqlite:

ffbx.sh ~/.mozilla/firefox/41t52vmb.default/places.sqlite

Output bookmarks from all places.sqlite files found in ~/.mozilla/firefox subdirectories. In this case an additional column with the profile name is shown:

ffbx.sh

Example on a new profile

Testing on a new profile with one new bookmark added (the last one).

ffbx.sh ~/.mozilla/firefox/ffbx-example/places.sqlite

the result:

1391725993809844        Bookmarks Toolbar       https://www.mozilla.org/en-US/firefox/central/  Getting Started
1391725993811277        Mozilla Firefox https://www.mozilla.org/en-US/firefox/help/     Help and Tutorials
1391725993812029        Mozilla Firefox https://www.mozilla.org/en-US/firefox/customize/        Customize Firefox
1391725993812829        Mozilla Firefox https://www.mozilla.org/en-US/contribute/       Get Involved
1391725993813492        Mozilla Firefox https://www.mozilla.org/en-US/about/    About Us
1391725993870487        Bookmarks Toolbar       place:sort=8&maxResults=10      Most Visited
1391725993870988        Bookmarks Menu  place:folder=BOOKMARKS_MENU&folder=UNFILED_BOOKMARKS&folder=TOOLBAR&queryType=1&sort=12&maxResults=10&excludeQueries=1  Recently Bookmarked
1391725993871436        Bookmarks Menu  place:type=6&sort=14&maxResults=10      Recent Tags
1391726063106065        Unsorted Bookmarks      https://github.com/websafe/ffbx websafe/ffbx · GitHub   Firefox,bookmarks,extract,Bash,script,SQLite

Combining with PHP

PHP arrays for each row:

ffbx.sh \
    ~/.mozilla/firefox/ffbx-example/places.sqlite \
    | php -r 'while(!feof(STDIN)){print_r(fgetcsv(STDIN,4096,"\t"));}'

the result:

Array
(
    [0] => 1391725993809844
    [1] => Bookmarks Toolbar
    [2] => https://www.mozilla.org/en-US/firefox/central/
    [3] => Getting Started
    [4] => 
)
Array
(
    [0] => 1391725993811277
    [1] => Mozilla Firefox
    [2] => https://www.mozilla.org/en-US/firefox/help/
    [3] => Help and Tutorials
    [4] => 
)
Array
(
    [0] => 1391725993812029
    [1] => Mozilla Firefox
    [2] => https://www.mozilla.org/en-US/firefox/customize/
    [3] => Customize Firefox
    [4] => 
)
Array
(
    [0] => 1391725993812829
    [1] => Mozilla Firefox
    [2] => https://www.mozilla.org/en-US/contribute/
    [3] => Get Involved
    [4] => 
)
Array
(
    [0] => 1391725993813492
    [1] => Mozilla Firefox
    [2] => https://www.mozilla.org/en-US/about/
    [3] => About Us
    [4] => 
)
Array
(
    [0] => 1391725993870487
    [1] => Bookmarks Toolbar
    [2] => place:sort=8&maxResults=10
    [3] => Most Visited
    [4] => 
)
Array
(
    [0] => 1391725993870988
    [1] => Bookmarks Menu
    [2] => place:folder=BOOKMARKS_MENU&folder=UNFILED_BOOKMARKS&folder=TOOLBAR&queryType=1&sort=12&maxResults=10&excludeQueries=1
    [3] => Recently Bookmarked
    [4] => 
)
Array
(
    [0] => 1391725993871436
    [1] => Bookmarks Menu
    [2] => place:type=6&sort=14&maxResults=10
    [3] => Recent Tags
    [4] => 
)
Array
(
    [0] => 1391726063106065
    [1] => Unsorted Bookmarks
    [2] => https://github.com/websafe/ffbx
    [3] => websafe/ffbx · GitHub
    [4] => Firefox,bookmarks,extract,Bash,script,SQLite,
)

JSON for each row:

ffbx.sh \
    ~/.mozilla/firefox/ffbx-example/places.sqlite \
    | php -r 'while(!feof(STDIN)){echo json_encode(fgetcsv(STDIN,4096,"\t")).PHP_EOL;}'

the result:

["1391725993809844","Bookmarks Toolbar","https:\/\/www.mozilla.org\/en-US\/firefox\/central\/","Getting Started",""]
["1391725993811277","Mozilla Firefox","https:\/\/www.mozilla.org\/en-US\/firefox\/help\/","Help and Tutorials",""]
["1391725993812029","Mozilla Firefox","https:\/\/www.mozilla.org\/en-US\/firefox\/customize\/","Customize Firefox",""]
["1391725993812829","Mozilla Firefox","https:\/\/www.mozilla.org\/en-US\/contribute\/","Get Involved",""]
["1391725993813492","Mozilla Firefox","https:\/\/www.mozilla.org\/en-US\/about\/","About Us",""]
["1391725993870487","Bookmarks Toolbar","place:sort=8&maxResults=10","Most Visited",""]
["1391725993870988","Bookmarks Menu","place:folder=BOOKMARKS_MENU&folder=UNFILED_BOOKMARKS&folder=TOOLBAR&queryType=1&sort=12&maxResults=10&excludeQueries=1","Recently Bookmarked",""]
["1391725993871436","Bookmarks Menu","place:type=6&sort=14&maxResults=10","Recent Tags",""]
["1391726063106065","Unsorted Bookmarks","https:\/\/github.com\/websafe\/ffbx","websafe\/ffbx \u00b7 GitHub","Firefox,bookmarks,extract,Bash,script,SQLite,"]
false

ffbx's People

Contributors

websafe avatar

Watchers

 avatar

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.