Camille Frantz da8dab537d
All checks were successful
DailyXKCD / deploy (push) Successful in 32s
ReleaseBot / deploy (push) Successful in 20s
QuotesBot / deploy (push) Successful in 1m0s
QuipBot / deploy (push) Successful in 50s
PuppyBot / deploy (push) Successful in 20s
remove the start and end messages too
2026-05-08 12:50:39 -05:00
2026-03-22 16:18:08 -05:00
2026-03-22 16:18:08 -05:00
2026-03-23 00:15:39 +00:00
2025-06-11 02:41:45 -05:00
2025-12-30 21:02:35 +00:00
2025-12-30 21:02:35 +00:00
2026-03-23 02:23:25 +00:00
2026-03-23 03:00:06 +00:00
2025-12-30 15:11:00 -06:00

fyrfli's ActivityPub bots project

A collection of simple bots that post to an ActivityPub-compatible account that implements the Mastodon API. (Tested with Gotosocial and Mastodon Glitch Edition)

To run any of these bots for yourself, you will need:

  • a git repository on a forge that supports github actions* (Gitea, Forgejo, Codeberg, and, of course, Github)
  • the ability to add secrets to the repository
  • an ActivityPub enabled account that supports the Mastodon API (only tested with Mastodon-glitch and Gotosocial at the moment)
  • optionally a Pushover account.
  • an Apprise notification URL

Current bot list:

  • Dog facts (dogs_facts.py) is a little bit of code I wrote in one my lazy, brain-foggy days.
  • Quips (quip.py) I adopted the code I use for the white nonsense bot to use any provided text file that contains a basic list of sayings.
  • Quotes, my first bot. It reads a simple csv-formatted file of quotes.
  • Repository Release watch, this one reads a list of feed urls and checks for a new entry in the last 8 hours. I have it running every 8 hours. This one does not post to an ActivityPub compatible account/feed... yet.
  • The PuppyBot finally made it over. Initially, I was using the Mastodon.py library to post because I couldn't figure out how to make requests upload files. But (a) I didn't want to depend on an external library that may or may not suffer from update lag later on and (b) I wanted to get my hands dirty. So after many months of trial and error and brain fog and forgetfulness and fatigue, I finally figured it out.
  • The daily XKCD bot posts today's XKCD to my sandbox account. For now it's just for me, but I could be persuaded to make it available to everyone. DM me for more info (iykyk).

Requirements

All the bots here expect the following secrets:

- BOTS_ENDPOINT        # The URL of your ActivityPub instances (e.g. mastodon.social)
- APPRISE_URL          # The Apprise URL for whichever notification service you use (see https://appriseit.com/getting-started for more information)

N.B. I have included the code to use the Apprise library. At the moment, it will only use one url in the format: service://credentials/direction/?parameter=value. It is possible to send to multiple notification services, but I didn't see any need to do so at the moment.

Additionally, each have specific requirement outlined below.

Dog Facts bot

For this bot, you only need an access token that can wrtite posts to your instance. It grabs a random fact from a (up until now) free /facts API endpoint

The Quips Bot

This bot reads a text file containing one line of text per statement. The secrets expected are aa follows:

- QUIP_FILE            # URL to your text file; it expects an https endpoint
- QUIP_TOKEN           # Access token to your ActivityPub account
- QUIP_TAGS            # Additional tags you want posted; the code posts with a "#Bot" tag regardless of this value

Currently, I use this code to post to the White Nonsense Bot account

The Random Quotes bot

A comma-separated formatted text file of quotes and authors like so:

quote,author
"Amet lorem voluptatem tempore sint quod? Nam porro aliquid aspernatur assumenda fugiat A odit excepturi facere vero nihil Nulla voluptate accusantium vero recusandae nulla Obcaecati nemo dolor non reprehenderit excepturi23", "Example Author"
"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla","Author Exemplaris",
...

This bot requires only an additional secret with the path to your quotes file.

Release tracker

A secret containing a comma-separated string of urls to the repository releases via the API:

https://api.github.com/repos/owner/repository/releases,https://codeberg.org/api/v1/repos/owner/repository/releases

As of now, it only posts to Pushover and it requires a Pushover user and app.

PuppyBot

This bot requires two extra secrets:

- BOTS_PUPPYBOT_TOKEN     # Access token to your ActivityPub account
- UNSPLASH_API_KEY        # API Token from Unsplash.com issued via the developer panel 
                            - https://unsplash.com/developers.

Still to come:

  • A newsfeed bot that reads from a list of rss or atom feeds and posts latest entries.
  • Release tracker bot that watches a provided list of got repositories and posts releases to a selected endpoint
  • Make the release tracker post to discord again Now provided via the Apprise library
  • The puppybot code needs to be able to upload media via the requests library before I am willing to include it here.

Maybe someday

  • Provide several options for output - e.g. Discord, Telegram, etc. Functionality now provided via the Apprise library
Description
No description provided
Readme 361 KiB
Languages
Python 100%