janet-mastodon-bookmarks/README.md

52 lines
1.3 KiB
Markdown
Raw 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)
## Setup & Run
- Get an access token for your Mastodon account
![](image1.png)
![](image2.png)
- Run the program
```sh
2024-06-23 22:31:47 +02:00
$ ./mastodon-bookmarks YOUR_INSTANCE YOUR_APP_TOKEN
2024-06-23 22:19:04 +02:00
```
2024-06-23 22:33:28 +02:00
The `YOUR_INSTANCE` value must not have the trailing slash (e.g: `https://hachyderm.io`)
2024-06-23 22:31:47 +02:00
2024-06-23 22:19:04 +02:00
## Development
- Clone this repository
2024-06-23 11:02:11 +02:00
- Install Janet and jpm https://janet-lang.org/
- `jpm deps --local`
2024-06-23 22:19:04 +02:00
```sh
2024-06-23 22:31:47 +02:00
$ janet main.janet YOUR_INSTANCE YOUR_APP_TOKEN
2024-06-23 22:19:04 +02:00
```
2024-06-23 11:02:11 +02:00
## Build binary
2024-06-21 22:59:04 +02:00
2024-06-23 22:19:04 +02:00
```sh
$ jpm build
```
## 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).