This fun little service texts me whenever the homies hop on Xbox Live.
Xbox Live doesn't offer any webhooks or data change feeds we can integrate with, so I built something simple myself. Everything here is event-driven with a "push-based" design so that this service can be completely serverless, managed via Cloud Run.
- Hits endpoint every 5 minutes:
/xbox-live-presences/queue-sync
- Enqueues job to sync Xbox Live presence data for all of my friends via Cloud Tasks
- Queue items are processed via endpoint:
/xbox-live-presences/sync
- Queue items are processed via endpoint:
- Retrieves Xbox Live friend data, including presence status via https://peoplehub.xboxlive.com/users/me/people/social
- Upserts presence records to the DB
- If any presence status changes are detected, publish presence ID and new status via Pub/Sub
- Topic has a push subscription handled via endpoint:
/subscriptions/xbox-live-status-changed
- Topic has a push subscription handled via endpoint:
- Filter out any presence changes that are not Offline -> Online
- Send notification text message via Twilio