Social media automation bot for Animal Battle Stats - an animal powerscaling/battle stats database with 225+ animals.
- Daily Animal Spotlights - Featured animal with full stat breakdown
- VS Matchups - "Who would win" comparisons with statistical analysis
- Power Rankings - Top 10 most powerful animals
- Fun Facts - Interesting statistical insights
- Reddit - Posts to r/whowouldwin, r/animals, r/natureismetal, r/dataisbeautiful
- Discord - Webhook-based posting with rich embeds
- Twitter/X - (Coming soon)
git clone https://github.com/yourusername/ABS-PostBot.git
cd ABS-PostBot
npm installCopy the example environment file:
cp .env.example .env- Go to reddit.com/prefs/apps
- Click "create another app..."
- Fill in:
- Name: ABS-PostBot
- Type: Select "script"
- Description: Animal Battle Stats social media bot
- Redirect URI:
http://localhost:8080
- Click "create app"
- Note down:
- Client ID: The string under "personal use script"
- Client Secret: The "secret" field
- Add to
.env:REDDIT_CLIENT_ID=your_client_id REDDIT_CLIENT_SECRET=your_client_secret REDDIT_USERNAME=your_reddit_username REDDIT_PASSWORD=your_reddit_password REDDIT_USER_AGENT=ABS-PostBot/1.0.0 (by /u/your_username)
- Open Discord and go to your server
- Go to Server Settings > Integrations > Webhooks
- Click "New Webhook"
- Configure name and channel
- Click "Copy Webhook URL"
- Add to
.env:DISCORD_WEBHOOK_URL=your_webhook_url
npm run test:apinpm run test:contentnpm run test:reddit
npm run test:discordnpm run dry-run# Post spotlight to all platforms
npm run post:spotlight
# Post matchup
npm run post:matchup
# Post rankings
npm run post:rankings
# Post fun fact
npm run post:funfact# Post to specific platform
npm start -- --type=spotlight --platform=discord
# Post to specific subreddit
npm start -- --type=matchup --subreddit=whowouldwin
# Dry run
npm start -- --type=rankings --dry-runThe bot includes a GitHub Actions workflow for automated posting.
| Content Type | Frequency | Time (EST) |
|---|---|---|
| Spotlight | Daily | 9:00 AM |
| Matchup | Mon/Wed/Fri | 1:00 PM |
| Rankings | Sunday | 10:00 AM |
Go to your repository Settings > Secrets and variables > Actions and add:
REDDIT_CLIENT_IDREDDIT_CLIENT_SECRETREDDIT_USERNAMEREDDIT_PASSWORDREDDIT_USER_AGENTDISCORD_WEBHOOK_URL
You can manually trigger posts from the Actions tab in GitHub.
ABS-PostBot/
├── src/
│ ├── platforms/
│ │ ├── reddit.js # Reddit API integration
│ │ ├── discord.js # Discord webhook integration
│ │ └── twitter.js # Twitter (placeholder)
│ ├── content/
│ │ ├── animalSpotlight.js # Daily spotlight generator
│ │ ├── matchups.js # VS matchup generator
│ │ ├── rankings.js # Power rankings generator
│ │ └── funFacts.js # Fun facts generator
│ ├── utils/
│ │ ├── api.js # Animal Battle Stats API client
│ │ ├── screenshot.js # Puppeteer screenshot utility
│ │ └── logger.js # Post logging utility
│ ├── test/
│ │ ├── testApi.js
│ │ ├── testContent.js
│ │ ├── testReddit.js
│ │ ├── testDiscord.js
│ │ └── testScreenshot.js
│ └── index.js # Main entry point
├── .github/
│ └── workflows/
│ └── post.yml # GitHub Actions workflow
├── .env.example
├── package.json
└── README.md
All public, no authentication required:
GET /api/animals- All animalsGET /api/animals/[id]- Single animal by IDGET /api/random- Random animalGET /api/rankings- Power rankingsGET /api/search?q=query- Search animals
Posts use a professional, data-driven voice:
- Wildlife documentary meets sports analytics
- SEO-friendly language ("Statistical Analysis", "Power Rankings", "Combat Statistics")
- No emojis
- Authoritative, research-like presentation
- Always cites Animal Battle Stats as the data source
- Reddit: 1 post per subreddit per hour recommended
- Discord: No strict limit for webhooks
- The bot tracks recent posts to avoid spam
MIT