The Elephant and the Serpent: Using Mastodon with Python
summary
Explains how Mastodon’s federation actually works using ActivityPub server-to-server federation and the inbox/outbox model, shows OAuth flow to get an OAuth access token, demos HTTP requests with requests then the mastodon.py client library, and builds a bot that posts random lines from the Zen of Python to a botsin.space account. The demo obtains a token, posts successfully, and discusses hosting options (cron, VPS, Heroku scheduler) and moderation via server blocks.
AI-written summary · about
chapters (30)
- 0:00Introduction
- 0:47Magic
- 2:04Twitter is Magic
- 2:38Twitter is Dark Magic
- 3:08Incentives and Advertising
- 3:55Social Networks
- 4:09Mastodon
- 4:48Mastodon Web Interface
- 5:07Main Compose Bar
- 5:52Content Warning Visibility
- 6:12Home Column
- 6:44Federated Timeline
- 7:08Activity Pub
- 7:39Alice and Bob
- 8:27Server to Server Protocol
- 8:56Network Resiliency
- 9:31Server to Server moderation
- 9:46Magic of Communities
- 12:01The API
- 12:31Building a bot
- 12:42OAuth
- 13:17Access Token
- 14:08Making Requests
- 14:25Post Request
- 14:43Request Library
- 15:11Setting up Mastodon
- 16:20Web Browser
- 17:40Importing Strings
- 18:28Writing the Script
- 19:43How to Join
related talks
28mHarnessing the APIs you didn't know existed
13mDiscover the fediverse in less than 15 minutes
30mJoin the Fediverse with API Platform!
27mTelegram bots with Python? Why not?
33m"Python + Discord = Great Bots!"
01h 02mUsing Python to Power Serverless Applications
18mFrom the Fediverse to the Open Social Web
24mUsing Python, Django, and ruthlessness to protect people from social media harassment.
