janet-mastodon-bookmarks/README.md

55 lines
1.4 KiB
Markdown
Raw Permalink Normal View History

2024-06-23 22:19:04 +02:00
# Mastodon Bookmarks Archive
2024-06-21 22:59:04 +02:00
2024-06-23 22:19:04 +02:00
_A small Janet script to archive all your Mastodon bookmarks in Markdown files._
Because Mastodon posts can disappear for a variety of reasons (deletion, defederation, server instance shutdown, ...), it is safer to archive your bookmarks.
Each Markdown file will contain:
2024-06-25 11:31:33 +02:00
- [x] A link to the original post
- [x] The author's handle
- [x] The post's content in HTML
- [x] The media attachments locally downloaded
- [x] If available, the alt text for each media
- [ ] The full thread, if applicable
- [ ] The link card, if any
2024-06-23 22:19:04 +02:00
Most of these values will be in the form of `key:: value` for easy integration with Obsidian's plugin Dataview. A sample script is available [here](./dataview-query.js)
2024-06-25 15:40:28 +02:00
## Build & Run
2024-06-23 22:19:04 +02:00
2024-06-25 15:40:28 +02:00
### Pre-requirements
2024-06-23 22:19:04 +02:00
```sh
2024-06-25 15:40:28 +02:00
# Required by the httprequest dependency
$ sudo apt install libcurl4-openssl-dev
2024-06-23 22:19:04 +02:00
```
- Clone this repository
2024-06-23 11:02:11 +02:00
- Install Janet and jpm https://janet-lang.org/
2024-06-25 15:40:28 +02:00
- Get an access token for your Mastodon account
![](image1.png)
![](image2.png)
### Run
2024-06-23 11:02:11 +02:00
2024-06-23 22:19:04 +02:00
```sh
2024-06-25 13:39:01 +02:00
# Install dependencies locally with -l (--local)
$ jpm deps -l
# Tell jpm that our dependencies are local, before starting the script
$ jpm -l janet main.janet YOUR_INSTANCE YOUR_APP_TOKEN
2024-06-23 22:19:04 +02:00
```
2024-06-23 11:02:11 +02:00
2024-06-25 15:40:28 +02:00
The `YOUR_INSTANCE` value **must not** have the trailing slash (e.g: `https://hachyderm.io`)
### Build for release
2024-06-21 22:59:04 +02:00
2024-06-23 22:19:04 +02:00
```sh
2024-06-25 13:39:01 +02:00
$ jpm build -l
2024-06-23 22:19:04 +02:00
```
## LICENSE
2024-06-21 22:59:04 +02:00
2024-06-23 22:19:04 +02:00
Licensed under [GPL-3](https://www.tldrlegal.com/license/gnu-general-public-license-v3-gpl-3).