2017-10-30 07:29:25 -04:00
# Bookmark Archiver <img src="https://nicksweeting.com/images/archive.png" height="22px"/> [![Github Stars](https://img.shields.io/github/stars/pirate/bookmark-archiver.svg)](https://github.com/pirate/bookmark-archiver) [![Twitter URL](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/thesquashSH)
2017-06-30 14:17:41 -04:00
2017-10-30 07:29:25 -04:00
"Your own personal Way-Back Machine"
2018-06-10 23:12:33 -04:00
▶️ [Quickstart ](#quickstart ) | [Details ](#details ) | [Configuration ](#configuration ) | [Manual Setup ](#manual-setup ) | [Troubleshooting ](#troubleshooting ) | [Demo ](https://archive.sweeting.me ) | [Changelog ](#changelog ) | [Donate ](https://github.com/pirate/bookmark-archiver/blob/master/DONATE.md )
2017-10-31 19:28:11 -04:00
---
2018-09-20 12:32:14 -04:00
Save an archived copy of the websites you visit (the actual *content* of each site, not just the list of links).
2017-06-30 14:17:41 -04:00
2018-06-10 18:32:51 -04:00
Can import links from:
2018-09-20 12:32:41 -04:00
- < img src = "https://nicksweeting.com/images/bookmarks.png" height = "22px" /> Browser history or bookmarks (Chrome, Firefox, Safari, IE, Opera)
2017-10-30 07:29:25 -04:00
- < img src = "https://getpocket.com/favicon.ico" height = "22px" /> Pocket
- < img src = "https://pinboard.in/favicon.ico" height = "22px" /> Pinboard
2018-05-31 02:26:41 -04:00
- < img src = "https://nicksweeting.com/images/rss.svg" height = "22px" /> RSS or plain text lists
2017-10-30 07:29:25 -04:00
- Shaarli, Delicious, Instapaper, Reddit Saved Posts, Wallabag, Unmark.it, and more!
2018-06-10 18:32:51 -04:00
2018-06-11 12:39:31 -04:00
For each site, it outputs (configurable):
2018-06-10 18:32:51 -04:00
- Browsable static HTML archive (wget)
- PDF (Chrome headless)
- Screenshot (Chrome headless)
- DOM dump (Chrome headless)
- Favicon
- Submits URL to archive.org
- Index summary pages: index.html & index.json
2017-05-05 05:15:19 -04:00
2018-06-10 18:32:51 -04:00
The archiving is additive, so you can schedule `./archive` to run regularly and pull new links into the index.
2018-06-12 01:52:32 -04:00
All the saved content is static and indexed with json files, so it lives forever & is easily parseable, it requires no always-running backend.
2017-07-04 06:57:42 -04:00
2018-05-31 02:26:41 -04:00
[DEMO: archive.sweeting.me ](https://archive.sweeting.me )
2017-10-30 07:29:36 -04:00
2018-06-10 23:05:58 -04:00
< img src = "https://i.imgur.com/q3Oz9wN.png" width = "75%" alt = "Desktop Screenshot" align = "top" > < img src = "https://i.imgur.com/TG0fGVo.png" width = "25%" alt = "Mobile Screenshot" align = "top" > < br / >
2017-05-05 05:10:50 -04:00
## Quickstart
2017-12-20 00:07:01 -05:00
**1. Get your list of URLs:**
2017-06-30 01:57:20 -04:00
2017-06-30 14:05:30 -04:00
Follow the links here to find instructions for exporting bookmarks from each service.
2017-06-30 01:57:20 -04:00
- [Pocket ](https://getpocket.com/export )
- [Pinboard ](https://pinboard.in/export/ )
- [Instapaper ](https://www.instapaper.com/user/export )
2017-09-07 17:56:35 -04:00
- [Reddit Saved Posts ](https://github.com/csu/export-saved-reddit )
2018-09-24 15:54:30 -04:00
- [Shaarli ](https://shaarli.readthedocs.io/en/master/guides/backup-restore-import-export/#export-links-as )
2017-06-30 01:57:20 -04:00
- [Unmark.it ](http://help.unmark.it/import-export )
2017-09-04 18:11:28 -04:00
- [Wallabag ](https://doc.wallabag.org/en/user/import/wallabagv2.html )
2017-06-30 01:57:20 -04:00
- [Chrome Bookmarks ](https://support.google.com/chrome/answer/96816?hl=en )
- [Firefox Bookmarks ](https://support.mozilla.org/en-US/kb/export-firefox-bookmarks-to-backup-or-transfer )
- [Safari Bookmarks ](http://i.imgur.com/AtcvUZA.png )
- [Opera Bookmarks ](http://help.opera.com/Windows/12.10/en/importexport.html )
- [Internet Explorer Bookmarks ](https://support.microsoft.com/en-us/help/211089/how-to-import-and-export-the-internet-explorer-favorites-folder-to-a-32-bit-version-of-windows )
2018-06-10 23:07:55 -04:00
- Chrome History: `./bin/export-browser-history --chrome`
- Firefox History: `./bin/export-browser-history --firefox`
2017-12-20 00:08:10 -05:00
- Other File or URL: (e.g. RSS feed) pass as second argument in the next step
2017-06-30 01:57:20 -04:00
(If any of these links are broken, please submit an issue and I'll fix it)
**2. Create your archive:**
2017-05-29 19:53:08 -04:00
```bash
2017-06-30 01:57:20 -04:00
git clone https://github.com/pirate/bookmark-archiver
cd bookmark-archiver/
2018-06-10 22:32:52 -04:00
./setup # install all dependencies
2018-06-11 12:39:31 -04:00
# add a list of links from a file
2018-06-10 22:32:52 -04:00
./archive ~/Downloads/bookmark_export.html # replace with the path to your export file or URL from step 1
2017-10-30 05:01:59 -04:00
2018-06-11 12:39:31 -04:00
# OR add a list of links from remote URL
2018-06-10 22:32:52 -04:00
./archive "https://getpocket.com/users/yourusername/feed/all" # url to an RSS, html, or json links file
2018-06-11 12:39:31 -04:00
# OR add all the links from your browser history
./bin/export-browser-history --chrome # works with --firefox as well, can take path to SQLite history db
2018-06-10 22:32:52 -04:00
./archive output/sources/chrome_history.json
2018-05-31 02:20:18 -04:00
2018-06-11 12:39:31 -04:00
# OR just continue archiving the existing links in the index
2018-05-31 02:20:18 -04:00
./archive # at any point if you just want to continue archiving where you left off, without adding any new links
2017-05-29 19:53:08 -04:00
```
2017-05-05 06:56:12 -04:00
2017-11-01 01:16:22 -04:00
**3. Done!**
2018-06-11 12:39:31 -04:00
You can open `output/index.html` to view your archive. (favicons will appear next to each title once it has finished downloading)
2017-11-01 01:16:22 -04:00
If you want to host your archive somewhere to share it with other people, see the [Publishing Your Archive ](#publishing-your-archive ) section below.
**4. (Optional) Schedule it to run every day**
2017-11-01 01:14:42 -04:00
You can import links from any local file path or feed url by changing the second argument to `archive.py` .
Bookmark Archiver will ignore links that are imported multiple times, it will keep the earliest version that it's seen.
This means you can add multiple cron jobs to pull links from several different feeds or files each day,
it will keep the index up-to-date without duplicate links.
This example archives a pocket RSS feed and an export file every 24 hours, and saves the output to a logfile.
```bash
2018-04-17 09:31:00 -04:00
0 24 * * * yourusername /opt/bookmark-archiver/archive https://getpocket.com/users/yourusername/feed/all > /var/log/bookmark_archiver_rss.log
0 24 * * * yourusername /opt/bookmark-archiver/archive /home/darth-vader/Desktop/bookmarks.html > /var/log/bookmark_archiver_firefox.log
2017-11-01 01:14:42 -04:00
```
(Add the above lines to `/etc/crontab` )
2017-11-01 01:16:57 -04:00
**Next Steps**
2017-06-30 14:23:43 -04:00
If you have any trouble, see the [Troubleshooting ](#troubleshooting ) section at the bottom.
2017-08-03 08:58:49 -04:00
If you'd like to customize options, see the [Configuration ](#configuration ) section.
2017-06-30 14:23:43 -04:00
2017-12-20 00:11:51 -05:00
If you want something easier than running programs in the command-line, take a look at [Pocket Premium ](https://getpocket.com/premium ) (yay Mozilla!) and [Pinboard Pro ](https://pinboard.in/upgrade/ ) (yay independent developer!). Both offer easy-to-use bookmark archiving with full-text-search and other features.
2017-06-30 02:50:57 -04:00
2017-06-30 01:57:20 -04:00
## Details
2017-10-30 07:17:14 -04:00
`archive.py` is a script that takes a [Pocket-format ](https://getpocket.com/export ), [JSON-format ](https://pinboard.in/export/ ), [Netscape-format ](https://msdn.microsoft.com/en-us/library/aa753582(v=vs.85 ).aspx), or RSS-formatted list of links, and downloads a clone of each linked website to turn into a browsable archive that you can store locally or host online.
2017-06-30 02:39:01 -04:00
2018-06-10 21:19:46 -04:00
The archiver produces an output folder `output/` containing an `index.html` , `index.json` , and archived copies of all the sites,
2017-10-30 07:17:14 -04:00
organized by timestamp bookmarked. It's Powered by [headless ](https://developers.google.com/web/updates/2017/04/headless-chrome ) Chromium and good 'ol `wget` .
2017-06-30 02:58:57 -04:00
2017-06-30 02:34:23 -04:00
For each sites it saves:
2017-05-05 05:15:19 -04:00
2017-05-05 05:21:35 -04:00
- wget of site, e.g. `en.wikipedia.org/wiki/Example.html` with .html appended if not present
- `output.pdf` Printed PDF of site using headless chrome
2018-06-10 18:35:13 -04:00
- `screenshot.png` 1440x900 screenshot of site using headless chrome
- `output.html` DOM Dump of the HTML after rendering using headless chrome
2017-05-29 14:05:16 -04:00
- `archive.org.txt` A link to the saved site on archive.org
2017-07-04 06:57:42 -04:00
- `audio/` and `video/` for sites like youtube, soundcloud, etc. (using youtube-dl) (WIP)
2017-12-20 00:12:49 -05:00
- `code/` clone of any repository for github, bitbucket, or gitlab links (WIP)
2017-10-30 05:01:59 -04:00
- `index.json` JSON index containing link info and archive details
2017-10-30 07:17:14 -04:00
- `index.html` HTML index containing link info and archive details (optional fancy or simple index)
2017-05-05 05:10:50 -04:00
2017-10-30 05:01:59 -04:00
Wget doesn't work on sites you need to be logged into, but chrome headless does, see the [Configuration ](#configuration )* section for `CHROME_USER_DATA_DIR` .
2017-07-06 17:58:53 -04:00
2017-07-01 13:22:40 -04:00
**Large Exports & Estimated Runtime:**
2017-06-30 03:01:38 -04:00
2017-07-01 13:22:40 -04:00
I've found it takes about an hour to download 1000 articles, and they'll take up roughly 1GB.
Those numbers are from running it single-threaded on my i5 machine with 50mbps down. YMMV.
You can run it in parallel by using the `resume` feature, or by manually splitting export.html into multiple files:
```bash
2018-04-17 07:00:06 -04:00
./archive export.html 1498800000 & # second argument is timestamp to resume downloading from
./archive export.html 1498810000 &
./archive export.html 1498820000 &
./archive export.html 1498830000 &
2017-07-01 13:22:40 -04:00
```
Users have reported running it with 50k+ bookmarks with success (though it will take more RAM while running).
2017-06-30 03:01:38 -04:00
## Configuration
2017-06-30 02:58:57 -04:00
2017-07-04 06:57:42 -04:00
You can tweak parameters via environment variables, or by editing `config.py` directly:
2017-06-30 02:58:57 -04:00
```bash
2018-04-17 07:00:06 -04:00
env CHROME_BINARY=google-chrome-stable RESOLUTION=1440,900 FETCH_PDF=False ./archive ~/Downloads/bookmarks_export.html
2017-06-30 02:58:57 -04:00
```
2017-07-05 17:42:26 -04:00
**Shell Options:**
- colorize console ouput: `USE_COLOR` value: [`True`]/`False`
- show progress bar: `SHOW_PROGRESS` value: [`True`]/`False`
2018-06-10 21:12:55 -04:00
- archive permissions: `OUTPUT_PERMISSIONS` values: [`755`]/`644`/`...`
2017-07-05 17:42:26 -04:00
**Dependency Options:**
- path to Chrome: `CHROME_BINARY` values: [`chromium-browser`]/`/usr/local/bin/google-chrome`/`...`
- path to wget: `WGET_BINARY` values: [`wget`]/`/usr/local/bin/wget`/`...`
**Archive Options:**
2017-08-03 10:24:41 -04:00
- maximum allowed download time per link: `TIMEOUT` values: [`60`]/`30`/`...`
2017-08-03 10:29:56 -04:00
- archive methods (values: [`True`]/`False`):
- fetch page with wget: `FETCH_WGET`
- fetch images/css/js with wget: `FETCH_WGET_REQUISITES` (True is highly recommended)
- print page as PDF: `FETCH_PDF`
- fetch a screenshot of the page: `FETCH_SCREENSHOT`
2018-06-10 18:27:26 -04:00
- fetch a DOM dump of the page: `FETCH_DOM`
2017-08-03 10:29:56 -04:00
- fetch a favicon for the page: `FETCH_FAVICON`
- submit the page to archive.org: `SUBMIT_ARCHIVE_DOT_ORG`
2017-07-05 17:42:26 -04:00
- screenshot: `RESOLUTION` values: [`1440,900`]/`1024,768`/`...`
2017-07-06 17:54:07 -04:00
- user agent: `WGET_USER_AGENT` values: [`Wget/1.19.1`]/`"Mozilla/5.0 ..."`/`...`
2017-10-30 07:17:14 -04:00
- chrome profile: `CHROME_USER_DATA_DIR` values: [`~/Library/Application\ Support/Google/Chrome/Default`]/`/tmp/chrome-profile`/`...`
2017-10-30 05:01:59 -04:00
To capture sites that require a user to be logged in, you must specify a path to a chrome profile (which loads the cookies needed for the user to be logged in). If you don't have an existing chrome profile, create one with `chromium-browser --disable-gpu --user-data-dir=/tmp/chrome-profile` , and log into the sites you need. Then set `CHROME_USER_DATA_DIR=/tmp/chrome-profile` to make Bookmark Archiver use that profile.
2018-09-21 20:41:11 -04:00
- output directory: `OUTPUT_DIR` values: [`$REPO_DIR/output`]/`/srv/www/bookmarks`/`...` Optionally output the archives to an alternative directory.
2017-07-05 17:42:26 -04:00
2017-07-04 06:57:42 -04:00
(See defaults & more at the top of `config.py` )
2017-06-30 02:58:57 -04:00
2018-06-11 12:43:17 -04:00
To tweak the outputted html index file's look and feel, just edit the HTML files in `archiver/templates/` .
2017-07-04 06:57:42 -04:00
2018-06-11 12:43:17 -04:00
The chrome/chromium dependency is _optional_ and only required for screenshots, PDF, and DOM dump output, it can be safely ignored if those three methods are disabled.
2017-08-03 08:58:49 -04:00
2017-05-05 05:19:25 -04:00
## Publishing Your Archive
2018-04-17 07:00:06 -04:00
The archive produced by `./archive` is suitable for serving on any provider that can host static html (e.g. github pages!).
2017-05-05 05:10:50 -04:00
2018-06-10 21:19:46 -04:00
You can also serve it from a home server or VPS by uploading the outputted `output` folder to your web directory, e.g. `/var/www/bookmark-archiver` and configuring your webserver.
2017-05-05 05:10:50 -04:00
2017-07-01 13:15:09 -04:00
Here's a sample nginx configuration that works to serve archive folders:
2017-05-05 05:19:25 -04:00
```nginx
2017-10-30 05:08:11 -04:00
location / {
2018-06-10 21:19:46 -04:00
alias /path/to/bookmark-archiver/output/;
2017-07-04 05:14:25 -04:00
index index.html;
2017-10-30 07:17:14 -04:00
autoindex on; # see directory listing upon clicking "The Files" links
2017-07-04 05:14:25 -04:00
try_files $uri $uri/ =404;
2017-05-05 05:19:25 -04:00
}
```
Make sure you're not running any content as CGI or PHP, you only want to serve static files!
2017-10-30 05:08:11 -04:00
Urls look like: `https://archive.example.com/archive/1493350273/en.wikipedia.org/wiki/Dining_philosophers_problem.html`
2017-05-05 05:19:25 -04:00
2017-06-30 14:05:30 -04:00
**Security WARNING & Content Disclaimer**
2017-06-30 14:02:08 -04:00
2017-10-30 07:18:50 -04:00
Re-hosting other people's content has security implications for any other sites sharing your hosting domain. Make sure you understand
2017-10-30 07:17:14 -04:00
the dangers of hosting unknown archived CSS & JS files [on your shared domain ](https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy ).
2017-10-30 07:18:50 -04:00
Due to the security risk of serving some malicious JS you archived by accident, it's best to put this on a domain or subdomain
of its own to keep cookies separate and slightly mitigate [CSRF attacks ](https://en.wikipedia.org/wiki/Cross-site_request_forgery ) and other nastiness.
2017-06-30 14:02:08 -04:00
2017-07-04 06:57:42 -04:00
You may also want to blacklist your archive in `/robots.txt` if you don't want to be publicly assosciated with all the links you archive via search engine results.
2017-06-30 14:02:08 -04:00
Be aware that some sites you archive may not allow you to rehost their content publicly for copyright reasons,
it's up to you to host responsibly and respond to takedown requests appropriately.
2018-04-17 09:31:00 -04:00
Please modify the `FOOTER_INFO` config variable to add your contact info to the footer of your index.
2017-06-30 03:12:52 -04:00
## Info & Motivation
2017-05-05 05:10:50 -04:00
2017-05-05 05:30:07 -04:00
This is basically an open-source version of [Pocket Premium ](https://getpocket.com/premium ) (which you should consider paying for!).
2017-05-05 05:15:19 -04:00
I got tired of sites I saved going offline or changing their URLS, so I started
archiving a copy of them locally now, similar to The Way-Back Machine provided
2017-05-05 09:26:40 -04:00
by [archive.org ](https://archive.org ). Self hosting your own archive allows you to save
PDFs & Screenshots of dynamic sites in addition to static html, something archive.org doesn't do.
2017-05-05 05:10:50 -04:00
Now I can rest soundly knowing important articles and resources I like wont dissapear off the internet.
2018-07-08 06:36:35 -04:00
My published archive as an example: [archive.sweeting.me ](https://archive.sweeting.me ).
2017-05-05 05:15:19 -04:00
2017-06-30 14:17:41 -04:00
## Manual Setup
2017-07-25 15:15:46 -04:00
If you don't like running random setup scripts off the internet (:+1:), you can follow these manual setup instructions.
2017-06-30 14:17:41 -04:00
2017-10-18 18:38:17 -04:00
**1. Install dependencies:** `chromium >= 59` ,` wget >= 1.16`, `python3 >= 3.5` (`google-chrome >= v59` works fine as well)
2017-06-30 14:17:41 -04:00
If you already have Google Chrome installed, or wish to use that instead of Chromium, follow the [Google Chrome Instructions ](#google-chrome-instructions ).
2017-07-25 15:15:46 -04:00
2017-06-30 14:17:41 -04:00
```bash
# On Mac:
brew cask install chromium # If you already have Google Chrome/Chromium in /Applications/, skip this command
brew install wget python3
echo -e '#!/bin/bash\n/Applications/Chromium.app/Contents/MacOS/Chromium "$@"' > /usr/local/bin/chromium-browser # see instructions for google-chrome below
chmod +x /usr/local/bin/chromium-browser
```
```bash
# On Ubuntu/Debian:
apt install chromium-browser python3 wget
```
```bash
# Check that everything worked:
chromium-browser --version & & which wget & & which python3 & & which curl & & echo "[√] All dependencies installed."
```
**2. Get your bookmark export file:**
Follow the instruction links above in the "Quickstart" section to download your bookmarks export file.
**3. Run the archive script:**
1. Clone this repo `git clone https://github.com/pirate/bookmark-archiver`
3. `cd bookmark-archiver/`
2018-04-17 07:00:06 -04:00
4. `./archive ~/Downloads/bookmarks_export.html`
2017-06-30 14:17:41 -04:00
2017-10-30 07:20:36 -04:00
You may optionally specify a second argument to `archive.py export.html 153242424324` to resume the archive update at a specific timestamp.
2017-06-30 14:17:41 -04:00
If you have any trouble, see the [Troubleshooting ](#troubleshooting ) section at the bottom.
### Google Chrome Instructions:
2017-06-30 02:50:57 -04:00
I recommend Chromium instead of Google Chrome, since it's open source and doesn't send your data to Google.
Chromium may have some issues rendering some sites though, so you're welcome to try Google-chrome instead.
It's also easier to use Google Chrome if you already have it installed, rather than downloading Chromium all over.
2017-06-30 14:17:41 -04:00
1. Install & link google-chrome
2017-06-30 02:50:57 -04:00
```bash
# On Mac:
# If you already have Google Chrome in /Applications/, skip this brew command
brew cask install google-chrome
brew install wget python3
echo -e '#!/bin/bash\n/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome "$@"' > /usr/local/bin/google-chrome
chmod +x /usr/local/bin/google-chrome
```
```bash
# On Linux:
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
apt update; apt install google-chrome-beta python3 wget
```
2. Set the environment variable `CHROME_BINARY` to `google-chrome` before running:
```bash
2018-04-17 07:00:06 -04:00
env CHROME_BINARY=google-chrome ./archive ~/Downloads/bookmarks_export.html
2017-06-30 02:50:57 -04:00
```
2017-06-30 03:12:52 -04:00
If you're having any trouble trying to set up Google Chrome or Chromium, see the Troubleshooting section below.
2017-06-30 02:50:57 -04:00
## Troubleshooting
### Dependencies
**Python:**
On some Linux distributions the python3 package might not be recent enough.
If this is the case for you, resort to installing a recent enough version manually.
```bash
add-apt-repository ppa:fkrull/deadsnakes & & apt update & & apt install python3.6
```
If you still need help, [the official Python docs ](https://docs.python.org/3.6/using/unix.html ) are a good place to start.
**Chromium/Google Chrome:**
`archive.py` depends on being able to access a `chromium-browser` /`google-chrome` executable. The executable used
defaults to `chromium-browser` but can be manually specified with the environment variable `CHROME_BINARY` :
2017-07-25 15:15:46 -04:00
2017-06-30 02:50:57 -04:00
```bash
2018-04-17 07:00:06 -04:00
env CHROME_BINARY=/usr/local/bin/chromium-browser ./archive ~/Downloads/bookmarks_export.html
2017-06-30 02:50:57 -04:00
```
1. Test to make sure you have Chrome on your `$PATH` with:
2017-07-25 15:15:46 -04:00
2017-06-30 02:50:57 -04:00
```bash
which chromium-browser || which google-chrome
```
If no executable is displayed, follow the setup instructions to install and link one of them.
2. If a path is displayed, the next step is to check that it's runnable:
2017-07-25 15:15:46 -04:00
2017-06-30 02:50:57 -04:00
```bash
chromium-browser --version || google-chrome --version
```
If no version is displayed, try the setup instructions again, or confirm that you have permission to access chrome.
2017-07-04 07:46:15 -04:00
3. If a version is displayed and it's `<59` , upgrade it:
2017-07-25 15:15:46 -04:00
2017-07-04 07:46:15 -04:00
```bash
apt upgrade chromium-browser -y
# OR
brew cask upgrade chromium-browser
```
4. If a version is displayed and it's `>=59` , make sure `archive.py` is running the right one:
2017-07-25 15:15:46 -04:00
2017-06-30 02:50:57 -04:00
```bash
2018-04-17 07:00:06 -04:00
env CHROME_BINARY=/path/from/step/1/chromium-browser ./archive bookmarks_export.html # replace the path with the one you got from step 1
2017-06-30 02:50:57 -04:00
```
2017-07-04 07:46:15 -04:00
2017-06-30 02:50:57 -04:00
**Wget & Curl:**
If you're missing `wget` or `curl` , simply install them using `apt` or your package manager of choice.
See the "Manual Setup" instructions for more details.
2017-07-02 13:02:29 -04:00
If wget times out or randomly fails to download some sites that you have confirmed are online,
upgrade wget to the most recent version with `brew upgrade wget` or `apt upgrade wget` . There is
a bug in versions `<=1.19.1_1` that caused wget to fail for perfectly valid sites.
2017-06-30 03:12:52 -04:00
### Archiving
2017-06-30 03:52:21 -04:00
**No links parsed from export file:**
Please open an [issue ](https://github.com/pirate/bookmark-archiver/issues ) with a description of where you got the export, and
preferrably your export file attached (you can redact the links). We'll fix the parser to support your format.
2017-06-30 03:12:52 -04:00
**Lots of skipped sites:**
If you ran the archiver once, it wont re-download sites subsequent times, it will only download new links.
If you haven't already run it, make sure you have a working internet connection and that the parsed URLs look correct.
You can check the `archive.py` output or `index.html` to see what links it's downloading.
2018-06-11 23:02:52 -04:00
If you're still having issues, try deleting or moving the `output/archive` folder (back it up first!) and running `./archive` again.
2017-06-30 03:12:52 -04:00
**Lots of errors:**
Make sure you have all the dependencies installed and that you're able to visit the links from your browser normally.
Open an [issue ](https://github.com/pirate/bookmark-archiver/issues ) with a description of the errors if you're still having problems.
**Lots of broken links from the index:**
Not all sites can be effectively archived with each method, that's why it's best to use a combination of `wget` , PDFs, and screenshots.
If it seems like more than 10-20% of sites in the archive are broken, open an [issue ](https://github.com/pirate/bookmark-archiver/issues )
with some of the URLs that failed to be archived and I'll investigate.
### Hosting the Archive
If you're having issues trying to host the archive via nginx, make sure you already have nginx running with SSL.
If you don't, google around, there are plenty of tutorials to help get that set up. Open an [issue ](https://github.com/pirate/bookmark-archiver/issues )
if you have problem with a particular nginx config.
2017-07-04 06:57:42 -04:00
## Roadmap
If you feel like contributing a PR, some of these tasks are pretty easy. Feel free to open an issue if you need help getting started in any way!
2017-05-05 05:30:07 -04:00
2017-07-26 00:37:30 -04:00
- download closed-captions text from youtube videos
2017-05-05 05:30:07 -04:00
- body text extraction using [fathom ](https://hacks.mozilla.org/2017/04/fathom-a-framework-for-understanding-web-pages/ )
- auto-tagging based on important extracted words
- audio & video archiving with `youtube-dl`
2017-07-04 06:57:42 -04:00
- full-text indexing with elasticsearch/elasticlunr/ag
2017-05-05 05:30:07 -04:00
- video closed-caption downloading for full-text indexing video content
- automatic text summaries of article with summarization library
- feature image extraction
- http support (from my https-only domain)
2017-05-29 19:53:08 -04:00
- try wgetting dead sites from archive.org (https://github.com/hartator/wayback-machine-downloader)
2017-07-04 06:57:42 -04:00
- live updating from pocket/pinboard
2017-06-30 01:57:20 -04:00
It's possible to pull links via the pocket API or public pocket RSS feeds instead of downloading an html export.
Once I write a script to do that, we can stick this in `cron` and have it auto-update on it's own.
For now you just have to download `ril_export.html` and run `archive.py` each time it updates. The script
will run fast subsequent times because it only downloads new links that haven't been archived already.
2017-05-05 20:42:12 -04:00
## Links
2018-03-19 03:45:46 -04:00
**Similar Projects:**
- [Memex by Worldbrain.io ](https://github.com/WorldBrain/Memex ) a browser extension that saves all your history and does full-text search
- [Hypothes.is ](https://web.hypothes.is/ ) a web/pdf/ebook annotation tool that also archives content
- [Perkeep ](https://perkeep.org/ ) "Perkeep lets you permanently keep your stuff, for life."
- [Fetching.io ](http://fetching.io/ ) A personal search engine/archiver that lets you search through all archived websites that you've bookmarked
- [Shaarchiver ](https://github.com/nodiscc/shaarchiver ) very similar project that archives Firefox, Shaarli, or Delicious bookmarks and all linked media, generating a markdown/HTML index
- [Webrecorder.io ](https://webrecorder.io/ ) Save full browsing sessions and archive all the content
- [Wallabag ](https://wallabag.org ) Save articles you read locally or on your phone
**Discussions:**
2017-05-05 20:42:12 -04:00
- [Hacker News Discussion ](https://news.ycombinator.com/item?id=14272133 )
2017-05-29 19:53:08 -04:00
- [Reddit r/selfhosted Discussion ](https://www.reddit.com/r/selfhosted/comments/69eoi3/pocket_stream_archive_your_own_personal_wayback/ )
2017-06-30 14:00:29 -04:00
- [Reddit r/datahoarder Discussion #1 ](https://www.reddit.com/r/DataHoarder/comments/69e6i9/archive_a_browseable_copy_of_your_saved_pocket/ )
- [Reddit r/datahoarder Discussion #2 ](https://www.reddit.com/r/DataHoarder/comments/6kepv6/bookmarkarchiver_now_supports_archiving_all_major/ )
2018-03-19 03:45:46 -04:00
**Tools/Other:**
2017-05-05 20:42:12 -04:00
- https://github.com/ikreymer/webarchiveplayer#auto-load-warcs
2017-08-27 21:00:49 -04:00
- [Sheetsee-Pocket ](http://jlord.us/sheetsee-pocket/ ) project that provides a pretty auto-updating index of your Pocket links (without archiving them)
2017-09-07 18:06:37 -04:00
- [Pocket -> IFTTT -> Dropbox ](https://christopher.su/2013/saving-pocket-links-file-day-dropbox-ifttt-launchd/ ) Post by Christopher Su on his Pocket saving IFTTT recipie
2017-06-30 04:55:08 -04:00
## Changelog
2018-06-10 23:10:49 -04:00
- v0.1.0 released
- support for browser history exporting added with `./bin/export-browser-history`
2018-06-10 18:27:26 -04:00
- support for chrome `--dump-dom` to output full page HTML after JS executes
2017-10-30 07:09:33 -04:00
- v0.0.3 released
2017-10-30 05:08:11 -04:00
- support for chrome `--user-data-dir` to archive sites that need logins
- fancy individual html & json indexes for each link
- smartly append new links to existing index instead of overwriting
2017-10-30 07:09:33 -04:00
- v0.0.2 released
2017-07-05 14:18:22 -04:00
- proper HTML templating instead of format strings (thanks to https://github.com/bardisty!)
2017-07-04 06:57:42 -04:00
- refactored into separate files, wip audio & video archiving
2017-07-04 05:22:25 -04:00
- v0.0.1 released
- Index links now work without nginx url rewrites, archive can now be hosted on github pages
2017-06-30 04:55:08 -04:00
- added setup.sh script & docstrings & help commands
- made Chromium the default instead of Google Chrome (yay free software)
- added [env-variable ](https://github.com/pirate/bookmark-archiver/pull/25 ) configuration (thanks to https://github.com/hannah98!)
- renamed from **Pocket Archive Stream** -> **Bookmark Archiver**
- added [Netscape-format ](https://github.com/pirate/bookmark-archiver/pull/20 ) export support (thanks to https://github.com/ilvar!)
2017-06-30 14:00:29 -04:00
- added [Pinboard-format ](https://github.com/pirate/bookmark-archiver/pull/7 ) export support (thanks to https://github.com/sconeyard!)
- front-page of HN, oops! apparently I have users to support now :grin:?
- added Pocket-format export support
2017-07-04 05:22:25 -04:00
- v0.0.0 released: created Pocket Archive Stream 2017/05/05
2017-12-20 00:31:15 -05:00
## Donations
2017-12-20 00:33:54 -05:00
This project can really flourish with some more engineering effort, but unless it can support
me financially I'm unlikely to be able to take it to the next level alone. It's already pretty
functional and robust, but it really deserves to be taken to the next level with a few more
talented engineers. If you or your foundation wants to sponsor this project long-term, contact
me at bookmark-archiver@sweeting.me.
2017-12-20 00:31:15 -05:00
2017-12-20 00:33:06 -05:00
[Grants / Donations ](https://github.com/pirate/bookmark-archiver/blob/master/donate.md )