search tool for toots on mastodon
Experimental prototype
Tested with Python 3.9 and 3.7
Requires a keyring backend to be installed
-
git clone this repository
-
cd into repository
-
run
pip install .
This should install Mastodon.py 1.5.1
The command line script does not require the web service and authentication setup.
You only need to register your soot app under mastodon website / Preferences / Development / New Application
Keep note of the client-key
(aka client-id), client-secret
and access_token
as you will need to provide this information to soot.
Run the soot script by following instructions on
python3 soot/bm25.py -h
The web service provides a web front end for searching and filtering toots available to you.
You start the web server with the following command (also see help with -h
)
python3 soot/server.py --base-url=mastodon.social --host=$domain --port=5000
Authentication:
- Directing your client to your soot server's url
- you are asked to authenticate: Follow the link and login to your mastodon account and copy the authentication code.
- Navigate back to your soot server and paste the authentication token in the field.
- The access token will be stored in the web session (but not the password or your login handle)
Searching:
- Navigate to the soot server; you will now see the search box.
- enter query terms and/or mentions and hit "Search"
- you will see toots that contain the search terms (BM25 ranking)
- Note that for efficiency reasons you can only search the past 100 toots at the moment.
- Update to recent python
- Update to recent mastodon API
- Fix installation instructions
- Runs on flask web microframework
- supports copy&paste authentication via authorization tokens
- BM25 retrieval model on substrings
- No indexing, no caching
- Searches only 100 most recent posts in home timeline