A Twitter bot @ProductHunToday that tweets trending Product Hunt products every day, in short video!
- Remotion: Generate short video in React!
- Product Hunt API 2.0 (GraphQL): Fetch trending products
- Twitter API: Tweet post thread with video
- Tailwind CSS: UI of video content
- Github Actions: Run scheduled job everyday (fetch data from Product Hunt -> generate video -> post Twitter)
- google/zx: Write modern shell script in JavaScript
- Node.js: v16.14.0
https://twitter.com/ProductHunToday/status/1506186218714849287
yarn 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 <ProjectRoot>/data/today.json
yarn fetch
This will open browser to preview video
yarn start
This will store generated video in <ProjectRoot>/out/video.mp4
yarn build
yarn post-tweet
PRs are welcome!
Feel free to DM me on Twitter @EasonChang_me if any suggestions
Support me in creating more awesome projects!