| .gitignore | Update authorization flow: A webbrowser is no being opened. | |
| gts-oauth.py | Update authorization flow: A webbrowser is no being opened. | |
| gts-upload-emojis.py | Update authorization flow: A webbrowser is no being opened. | |
| README.md | Update authorization flow: A webbrowser is no being opened. | |
gts-scripts
This is a collection of useful GoToSocial scripts.
gts-oauth.py
Dependencies: python3-mastodon
This script executes the OAuth process in GTS and provides the bearer token.
Before executing the script following changes are to be considered in the script:
- Change
INSTANCE_URLvalue to match your instance URL. - Change
APP_NAMEto match your desired application name. - The script requests
read,write,admin:read, andadmin:writecredentials. If this is not what you want, you can change the script accordingly.
To execute the script call:
gts-oauth.py
During execution, the script creates registers a new app and stores the app id and secret in the file clientcred.secret.
If this file already exists, then no new app will be registered.
Instead the same app for the OAuth process will be used.
You might want to delete this file before execution to create a new app.
The app will redirect to a local webserver and starts your web browser in order to authenticate. Please authenticate in the browser with your user email address, password and 2FA token (if enabled).
After the successful authorization the file usercred.secret is being created.
In the first line of this file you find the bearer token that you can use for API calls.
gts-upload-emojis.py
This script processes MissKey compatible custom emoji packages and uploads the emojis to the GTS instance.
Before executing the script following changes are to be considered in the script:
- Change the
API_URLso that it fits the URL of your GTS instance.
To execute the script call:
gts-upload-emojis.py emoji_archive_file
emoji-arch-fileis the MissKey compatible ZIP file containing the emoji files andmeta.jsonfile.