Having difficulty finding a post of interest among the multitude of Hacker News posts? This Telegram bot can assist you. It monitors Hacker News posts based on your interests and sends you a summary generated by ChatGPT via a Telegram message.
This bot is scheduled to use ChatGPT to summarize Hacker News posts. At the designated time, the bot searches for posts from the previous hour, filters them using your specified keyword, and then sends you a Telegram message containing the summary.
- Create a bot from the template
- Add your OpenAI API key
- Configure the Telegram bot to send direct messages (personal chat ID) or group message
-
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.
Go to the Hacker News Alert ChatGPT Telegram 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.
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.
Set up the Telegram integration. You will need to
- Add your Telegram API token, which you can get from @botfather
- Add your Telegram Chat ID. The chat ID you use depends on whether you want the bot to send direct messages or group messages. Click here to learn more about finding your Telegram chat ID.
Finally, click Deploy.
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 set to summarize Hacker News posts.
To customize the time the bot sends Telegram messages, modify the value in the cron expression ("30 * * * *"). This expression means the bot sends messages on the 30th minute of every hour.
schedule_cron_job(String::from("30 * * * *"), keyword, callback).await;
To adjust the timing, you can change the number 30 to your preferred 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.