Searchable backup of mastodon toots
Note: this project is no longer maintained. Feel free to use yarfox for an alternative.
(It can cross-post to twitter, and does not depend on MongoDB ...)
Python 3.6 or higher
MongoDB server up and running
Use pipenv
to install the rest of Python deps
- Run the
register_app
andgen_token
scripts - Create a
~/.config/mastoback.yml
looking like:
# your mastodon instance
url: "https://mamot.fr"
auth:
# generated by the aforementioned scripts.
client_id: ...
client_secret: ...
access_token: ...
# Use for search
index_path: /some/writeable/path
Run mastodback fetch
to fetch your latest toots.
Use mastoback search <query>
to display matching toots.
$ mastoback search links
Found 10 results
--------------------------------------------------------------------------------
New link added to https://dmerej.info/blog/pages/links/
Daplie: https://daplie.com/
https://mamot.fr/@dmerej/98947577777033562
--------------------------------------------------------------------------------
New link added to https://dmerej.info/blog/pages/links/
js2js: https://eleks.github.io/js2js/
https://mamot.fr/@dmerej/3066566
- Why ?
Because I can.
- Why mongodb ?
I'm lazy and I wanted to store the whole data returned by the Mastodon API "just in case". Mongo is nice for this.
- Why Python 3.6 only ?
Because I wanted to play with mypy and I prefer type annotations to # type:
comments
- What's next ?
Nothing. I just wanted a searchable backup of my toots from the command line, so I don't think any new feature needs to be added.
I could spend more time on the conversion from html to text maybe, but apart from that I consider this project done.