Summarize Hacker News Posts Using ChatGPT — Discord version
Deploy this function on flows.network and receive hourly alerts with summarized Hacker News posts tailored to your interests.
You can also send the ChatGPT summary as a Slack Message.
How it works
This scheduled bot uses ChatGPT to summarize Hacker News posts. At the specified time, the bot searches for posts from the past hour, filters them based on your chosen keyword, and sends you a Discord message with a summary.
Deploy your own Hacker News summary bot in 3 steps
- Create a bot from a template
- Add your OpenAI API key
- Configure the bot on a specified Discord channel
0 Prerequisites
-
You will need to bring your own OpenAI API key. If you do not already have one, sign up here.
-
Sign up on flows.network using your GitHub account. It is free.
1 Create a bot from a template
Go to the Hacker News Alert ChatGPT Discord template.
Review the KEYWORD
variable to specify your keyword of interest (supporting only one keyword for each bot).
Click on the Create and Build button.
2 Configure the bot to access Discord
Set up the Discord integration. Enter the discord_channel_id
and discord_token
to configure the bot. Click here to learn how to get a Discord channel id and Discord bot token.
discord_channel_id
: Specify the channel where you want to deploy the bot. Copy and paste the final set of serial numbers from the discord channel’s webpage URL.discord_token
: Get the Discord token from the Discord Developer Portal.
Click Continue.
2 Add your OpenAI API key
Set up the OpenAI integration. Click on Connect, and enter your key. The default key name is Default
.
Close the tab and go back to the flow.network page once you are done. Finally, click Deploy.
Wait for the magic!
You are now on the flow details page and the flow function takes a few seconds to build. Once the flow’s status changes to running
, your bot is ready to summarize Hacker News posts.
FAQ
How to customize the bot’s scheduled messaging time?
To customize the time when the bot sends Discord messages, you can modify the value in the cron expression (“37 * * * *”). This expression means the bot sends messages at the 37th minute of every hour.
schedule_cron_job(String::from("37 * * * *"), keyword, callback).await;
To adjust the timing, you can change the number 37 to your desired minute. For example, if you want the messages to be sent at the 15th minute of every hour, you can modify the expression to be (“15 * * * *”).
By customizing the cron expression, you can set the desired timing for the bot to send Discord messages.