You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have no idea if this is any use to anyone, but I made a quick script to upload the daily Top 10 chart to a bot on my Mastodon server:
It's probably best to create a specific account and flag it as a bot on your mastodon server, so people can mute it specifically, rather than muting your normal account.
Create an API key by going to Development -> New Application, and give it "write:media" and "write:statuses" permissions
Save the "Your access token" string into a file on your Birdnet PI server (under '/home/birdnet/BirdNET-Pi/token.secret)
Install the python Mastodon module: pip3 install Mastodon.py
Save the below code into /home/birdnet/BirdNET-Pi/mastodonpost.py or similar
Make the file executable using chmod +x /home/birdnet/BirdNET-Pi/mastodonpost.py
Use crontab -e to edit the scheduler and run the command every day at 1minute past midnight:
Cool idea. But unfortunately it doesn't work for me. I have followed the instructions and adapted “api_base_url”.
I also had to adjust the paths slightly.
The error message is:
Traceback (most recent call last):
File “/home/pi/BirdNET-Pi/mastodonpost.py”, line 2, in <module>
from mastodon import Mastodon
ImportError: No module named mastodon
Does anyone know what I am doing wrong? Do I need to install another module?
Thank you!
Traceback (most recent call last):
File “/home/pi/BirdNET-Pi/mastodonpost.py”, line 2, in
from mastodon import Mastodon
ImportError: No module named mastodon
Does anyone know what I am doing wrong? Do I need to install another module? Thank you!
Oops, Sorry, i missed out an important first step:
I have no idea if this is any use to anyone, but I made a quick script to upload the daily Top 10 chart to a bot on my Mastodon server:
'/home/birdnet/BirdNET-Pi/token.secret
)pip3 install Mastodon.py
/home/birdnet/BirdNET-Pi/mastodonpost.py
or similarchmod +x /home/birdnet/BirdNET-Pi/mastodonpost.py
crontab -e
to edit the scheduler and run the command every day at 1minute past midnight:Python Script
mastodonpost.py
Edited: missed important step of installing python mastodon module
The text was updated successfully, but these errors were encountered: