- Shell 100%
| CRON_SETUP.md | ||
| linkding.config.json | ||
| linkding_export.sh | ||
| README.md | ||
Linkding processor
Small Node.js script to export bookmarks from my Linkding instance to HTML files.
The HTML uses the Netscape bookmark format, so the resulting files can be imported into browsers and other bookmark managers.
What it does
- Connects to my Linkding API
- Exports bookmarks by tag
- Can export all bookmarks with
* - Tag matching is case-insensitive
- Keeps bookmark titles, URLs, dates and tags
- Can create several exports in one run
- Uses only built-in Node.js modules
Files
linkding_export.js
linkding.config.json
The default config location is:
/home/rob/scripts/linkding-processor/linkding.config.json
A different config file can be supplied as the first argument.
Configuration
{
"baseUrl": "https://linkding.h02.swill.be",
"apiToken": "39d5d1abbaf39ef8de9ed9046cbb20540f645766",
"exports": [
{
"tag": "*",
"filename": "/mnt/filepile/webs/queueitanyway/root/www/bookmarks/bookmarks-all.html"
},
{
"tag": "selfhosted",
"filename": "/mnt/filepile/webs/queueitanyway/root/www/bookmarks/bookmarks-selfhosted.h>
},
{
"tag": "searchengine",
"filename": "/mnt/filepile/webs/queueitanyway/root/www/bookmarks/bookmarks-search-engin>
},
{
"tag": "2watch",
"filename": "/mnt/filepile/webs/queueitanyway/root/www/bookmarks/bookmarks-2watch.html"
}
]
}
Each entry in exports creates one HTML file.
Tags
Normal tag:
"tag": "linux"
All bookmarks:
"tag": "*"
The tag comparison is case-insensitive.
Running it
Using the default config:
node linkding_export.js
Using another config:
node linkding_export.js /path/to/config.json
Output
The generated HTML is in Netscape bookmark format and contains:
- Bookmark URL
- Bookmark title
- Original
date_added - Linkding tags
The files can therefore be imported into a browser or bookmark manager if needed.
Notes
The script currently requests a maximum of 1000 bookmarks per API call.
So if Linkding ever grows beyond 1000 bookmarks, pagination will need to be added.
No npm packages are required.