A Bluesky bot that posts whenever Seattle Mariners catcher Cal Raleigh gets a hit during a game.
The bot runs as a Val.town scheduled function every 5–10 minutes. It:
Home runs get special treatment — the bot fetches the season HR count and posts with extra flair.
@atproto/apiCreate an App Password in your Bluesky account settings (Settings → Privacy and Security → App Passwords). Do not use your main account password.
cal-hits-bot.jsBLUESKY_HANDLE — your Bluesky handle (e.g. yourbot.bsky.social)BLUESKY_PASSWORD — the App Password you created*/5 * * * * (or whatever)That's it. Val.town handles execution, logging, and storage.
npm install BLUESKY_HANDLE=your.handle.bsky.social BLUESKY_PASSWORD=your_app_password node cal-hits-bot.js
Change the player ID constant at the top of cal-hits-bot.js. You can look up
any player's ID from the MLB Stats API:
https://statsapi.mlb.com/api/v1/people/search?names=FirstName+LastName
You'll also want to update the team ID used for schedule lookups and the hashtags in the post template.
MIT