A Twitter bot @ProductHunToday that tweets trending Product Hunt products every day, in short video!
- 🎬 Daily video summaries of top 5 Product Hunt products
- 🕐 Twice daily posts: End-of-day summary (00:05 PST) and mid-day trending (12:00 PST)
- 📱 Square video format (720x720) optimized for Twitter
- 🤖 Fully automated via GitHub Actions
- Remotion v4: Generate short video in React!
- React v19: Latest React with improved performance
- TypeScript v5: Type-safe development
- Tailwind CSS v4: Modern utility-first CSS framework
- Product Hunt API 2.0 (GraphQL): Fetch trending products
- Twitter API v2: Tweet post thread with video
- GitHub Actions: Run scheduled job everyday (fetch data from Product Hunt -> generate video -> post Twitter)
- google/zx v8: Write modern shell script in JavaScript
- pnpm v10: Fast, disk space efficient package manager
- Node.js: v22 LTS
https://twitter.com/ProductHunToday/status/1506186218714849287
First, ensure you have Node.js v22 LTS installed (or use nvm
with the .nvmrc
file):
nvm use # If using nvm
pnpm install
Create .env
file, with your Product Hunt & Twitter API key
REACT_APP_PRODUCT_HUNT_API_KEY="<your-key>"
TWITTER_CONSUMER_KEY="<your-key>"
TWITTER_CONSUMER_SECRET="<your-key>"
TWITTER_ACCESS_TOKEN_KEY="<your-key>"
TWITTER_ACCESS_TOKEN_SECRET="<your-key>"
This will call Product Hunt API, and store result in data files
pnpm fetch # Stores in data/today.json
# For mid-day post (shows "Trending Now" instead of "Yesterday's Top 5")
pnpm fetch:midday # Stores in data/midday.json
This will open browser to preview video
pnpm start
This will store generated videos in the out directory
pnpm build # Outputs to out/video.mp4
# For mid-day post
pnpm build:midday # Outputs to out/midday-video.mp4
pnpm post-tweet
# For mid-day post
pnpm post-tweet:midday
pnpm test # Run linting and type checking
pnpm lint # Run ESLint only
pnpm lint:fix # Fix ESLint issues
# Run complete mid-day workflow (fetch + build + post)
pnpm midday
PRs are welcome!
Feel free to DM me on Twitter @EasonChang_me if any suggestions
Support me in creating more awesome projects!