How to Build a Simple ActivityPub Reminder Bot in Python

AmaseCocoa @cocoa@hackers.pub

This post guides you through building a simple ActivityPub bot in Python using the `apkit` library. The bot listens for mentions and schedules reminders for users. It covers setting up the project, generating cryptographic keys for secure communication, defining the bot's identity as an ActivityPub Actor, and initializing the `apkit` server. The tutorial walks through the core logic for parsing reminder commands, sending notifications, and defining necessary web endpoints like `/actor` and `/inbox`. It also details how to handle incoming activities, such as `Follow` and `Create` events, and how to run the application using `uvicorn`. While the example uses in-memory storage for simplicity, the post suggests improvements like persistent storage and robust task queuing for production environments. This tutorial provides a solid foundation for building more complex ActivityPub applications.

Read more →
15
1
0

❤️

15 people reacted.

Computers bend to my will.

Breakfast is my life's work.
All good things start with a roux.

Technologist, writer, who is fascinated by how new politics impacts technology and vice versa.

I argue semantics, professionally.

I also swear a lot.

She/her, but they/them is cool.

[avatar image is a middle aged white woman with glasses under pink/purple/blue lighting]
[header image of inclusive pride flags over a patio.]

He/him. Board member at CoSocial.ca.

Research Director, Social Web Foundation.

Director of Open Technology at Open Earth Foundation (OEF).

Author of "ActivityPub: Programming for the Social Web" from O'Reilly Media.

Founder of Wikitravel, StatusNet, identi.ca, Fuzzy.ai.

Creator of pump.io. Co-creator of GNU social.

Co-chair of the Social Web Working Group at W3C. Co-author of ActivityStreams 2.0. Co-author of ActivityPub. Co-author of OStatus.

Grad student in CS at Georgia Tech.

コミュニズム アナキズム ニヒリズム

中年(중년)中小企業(중소기업) 開發者(개발자), 90年代(년대) Console Gamer(콘솔 게이머). 좋은 하루를 繼續(계속)해 나아간다. 좋은 하루가 모이면 좋은 人生(인생)이 된다.

韓国人のプログラマー、40代、小学生の息子とゲームするのが幸せ😃💕龍が如く 、ゼルダの伝説、マリオ、ピクミン好き

「いい1日を続ける」
いい1日を続けていけば、いい人生になる!

nogajunの投稿が読めるのはMastodon だけ!ただのK-POP好きのおっさん。ヨジャ、ナムジャ問わず大好き。韓国語勉強してる。DebianとかLibreOfficeのオープンソース界隈に居たけど日本のコミュニティには嫌気がさしてる

Hi, I'm who's behind Fedify, Hollo, BotKit, and this website, Hackers' Pub! My main account is at @hongminhee洪 民憙 (Hong Minhee).

Fedify, Hollo, BotKit, 그리고 보고 계신 이 사이트 Hackers' Pub을 만들고 있습니다. 제 메인 계정은: @hongminhee洪 民憙 (Hong Minhee).

FedifyHolloBotKit、そしてこのサイト、Hackers' Pubを作っています。私のメインアカウントは「@hongminhee洪 民憙 (Hong Minhee)」に。

능력 없고 코딩 못하고 뭔가 이상한 걸 만들고 있고 (깃허브 추천인 서비스, http://referral.akaiaoon.dev) 신입한테도 기죽어지내고 이제 직장이 없어진 SE

Hi! My name is Muhammad, I am a 14 years old programmer and I love free software.
I code since I was 11 and I use Fedora GNU/Linux. (And yes, I always say GNU/Linux, you should too! 😉)
I created a react ui lib, if you wanna check that out: bafybeihpnjgdjrc7eujhsj4rvfypy
(Yeah it's hosted on ipfs, but we will get an ENS domain name if you donate ❤️)
The "free" in my username means free - ad in freedom. Free Software, Free 🇵🇸