A Mastodon Bot that posts dog images and quotes!
Go to file
heehee 3a48370c26 Update README.md 2024-03-30 01:59:53 +00:00
LICENSE Initial commit 2024-03-30 01:50:08 +00:00
README.md Update README.md 2024-03-30 01:59:53 +00:00
main.py Add main.py 2024-03-30 01:50:33 +00:00
requirements.txt Add requirements.txt 2024-03-30 01:51:35 +00:00

README.md

The code for @dogsnquotes@toot.community on Mastodon! (mirror)

Are you the owner of this code?

Yes, I am strangersdangers on GitHub. I am not impersonating anyone, so don't go ahead and make an issue saying I'm impersonating someone.

Acknowledgements

This code used the Quotable API, which was generously provided by Luke Peavey, and you can support him here! The code also used dog.ceo's API to get the dog images, so please donate to them here!

What is this?

This is a small Python project that I made in 3 days or so, I don't really remember! I was inspired to create a Mastodon bot after discovering that you can make bots on Mastodon!

How does it work?

This bot will send a random dog image from the dog.ceo API if you hit the route /post with the following parameters:

?pass={PASSWORD}: the password so you can prevent others from abusing your thing

?type=img: specify that the type is img (image)

This bot will ALSO send a random quote from the Quotable API if you hit the route /post with the following parameters:

?pass={PASSWORD}: the password so you can prevent others from abusing your thing

?type=text: specify that the type is text

SETUP

HOW TO CREATE A BOT

I recommend you to follow this guide

ACTUAL SETUP

1. In your .env (or variables), create a variable named "PASS", the value should be your PASSWORD for the web (not the password to the Mastodon bot)

2. You need to also add a variable called "TOKEN", the value should be the access token ( Development > Your app > Access token).

3. And the last variable you need to add is "INSTURL". The value of the variable should be the instance URL (the instance where you made the bot account at), INCLUDING THE FULL URL, IT SHOULD HAVE THE "https://" OR "http://"

Posting schedule

The cons is that in the code, there is no function for the bot to post on a schedule. And yes, I am aware that there is a parameter called scheduled_at, but that is not convenient to me at all, and that cron-job services are more convenient and more customizable. You can use cron-job services online like cron-job.org!

License

This code uses the MIT License.

Contributions

As I said earlier, this is just a small project, but all contributions are welcome. If you would like to make some changes to this code, go ahead!