| .gitignore | ||
| LICENSE | ||
| README.md | ||
| toot.sh | ||
Simple Toot
This is a Bash script designed to automate the process of sending welcoming messages to new users on a Mastodon instance. It utilizes the Mastodon API to send these messages.
Prerequisites
- Bash: Ensure you have Bash installed on your system.
- Curl: Used for making HTTP requests.
- jq: A lightweight and flexible command-line JSON processor. You'll need this to parse JSON responses.
- Access to a Mastodon Instance: You'll need access to a Mastodon instance to utilize this script.
Setup
-
Clone the repository:
git clone https://codeberg.org/RollenspielMonster/simple-toot.git -
Navigate to the cloned directory:
cd simple-toot -
Make the script executable:
chmod +x toot.sh -
Update the configuration variables in the script:
TOOL_NAME: The name of your tool.SERVER: The Mastodon instance's domain.CONFIG_PATH: The directory where configuration files will be stored.
Usage
-
Run the script:
./toot.sh -
Follow the on-screen instructions to authorize the tool to use your Mastodon account.
-
The script will send welcome messages to new users on your Mastodon instance.
Running with Systemd Timer
To schedule the execution of the script using a systemd timer to run every 5 minutes, follow these steps:
-
Create a Systemd Service File:
Create a file named
simple-toot.servicein the/etc/systemd/system/directory with the following content:[Unit] Description=Mastodon simple-toot service [Service] Type=oneshot User=root WorkingDirectory=/path/to ExecStart=/path/to/toot.sh [Install] WantedBy=multi-user.targetReplace
/path/to/toot.shwith the actual path to your script. -
Create a Systemd Timer File:
Create a file named
simple-toot.timerin the/etc/systemd/system/directory with the following content:[Unit] Description=Run Simple Toot Script every 5 minutes [Timer] OnCalendar=*:0/5 Unit=simple-toot.service [Install] WantedBy=timers.target -
Enable and Start the Timer:
Run the following commands to enable and start the timer:
sudo systemctl enable simple-toot.timer sudo systemctl start simple-toot.timerThis will start executing your script every 5 minutes.
-
Verify Timer Status:
To check the status of the timer, use:
sudo systemctl status simple-toot.timerThis command will show whether the timer is active and when it is next scheduled to run.
Note
- Ensure to replace
/path/towith the actual path to your script in both the service and timer files. - Adjust the
OnCalendarparameter in the timer file if you wish to change the interval at which the script runs.
Important Notes
- Ensure you have read and understand the Mastodon instance's policies regarding automated actions and spam prevention.
- It's recommended to run this script in a controlled environment to avoid unexpected behavior.
- This script assumes you have administrative privileges on the Mastodon instance.
- Make sure to review and adjust visibility settings (
-F "visibility=unlisted") in thesend_tootfunction as per your instance's policies.
Disclaimer
This script is provided as-is without any guarantees. Use it at your own risk.
License
This project is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.