Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link Parsing: Add support for browser history SQLite database #54

Closed
pirate opened this issue Nov 10, 2017 · 4 comments
Closed

Link Parsing: Add support for browser history SQLite database #54

pirate opened this issue Nov 10, 2017 · 4 comments

Comments

@pirate
Copy link
Member

pirate commented Nov 10, 2017

This will allow people to run BA as an archiver for all their browsing history, not just bookmarked pages.

h/t to @FiloSottile for the suggestion

@pirate pirate changed the title Link Parsing: Add support for Firefox and Chrome history SQLite database Link Parsing: Add support for browser history SQLite database Jan 10, 2018
@pirate
Copy link
Member Author

pirate commented Jun 10, 2018

Turns out it's really easy:

# Google Chrome / Chromium
# $1 default = ~/Library/Application Support/Google/Chrome/Default/History

cp "$1" .chrome_history.db.tmp
sqlite3 .chrome_history.db.tmp "SELECT \"[\" || group_concat(json_object('timestamp', last_visit_time, 'description', title, 'href', url)) || \"]\" FROM urls;" > downloads/chrome_history.json
rm .chrome_history.db.tmp

# Firefox
# $1 default =  ~/Library/Application\ Support/Firefox/Profiles/abc.default/places.sqlite
cp "$1" .firefox_history.db.tmp
sqlite3 .chrome_history.db.tmp "SELECT \"[\" || group_concat(json_object('timestamp', last_visit_date, 'description', title, 'href', url)) || \"]\" FROM moz_places;" > downloads/firefox_history.json
rm .firefox_history.db.tmp

@pirate
Copy link
Member Author

pirate commented Jun 11, 2018

This is done. On master you can now run:

./bin/export-browser-history --chrome
./archive output/sources/chrome_history.json
# OR
./bin/export-browser-history --firefox
./archive output/sources/firefox_history.json

@pirate pirate closed this as completed Jun 11, 2018
@GlassedSilver
Copy link

So since I run this in a docker on my server that is running Linux (unRAID to be precise) and my desktop being Windows what I have is a places.sqlite file in my Windows Firefox's profile folder.

I know that I can rsync it to my server, but how would I pass the sqlite file to Linux then? Your example assumes a .db file and probably default paths for running ArchiveBox on a Linux Desktop where the Firefox installation also resides?

Also, is there possibly any way to treat a history with a different level of care than separately passed pages? Like bookmarks I wanna frequently save new versions of, history I mostly care about saving once or maybe a few times per year. Reason is I wanna keep storage usage a bit in check as well as run times.

Sorry to break open an old issue, but this seems pretty relevant, happy to post in a separate issue if deemed necessary though. :) Thanks a lot for building this application by the way! <3

@pirate
Copy link
Member Author

pirate commented Aug 18, 2020

@GlassedSilver sorry I forgot to get back to this. If you still want help I recommend opening a new issue, happy to assist with making the bookmark transfer easy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants