This repository contains a bot that automatically posts the best comments from Hacker News to a specified Telegram channel.
To set up the HN Best Comments Bot, follow these steps:
-
Copy Files: Place
hn.jsandhn.pb.jsinto thepb_hooksdirectory of your PocketBase instance. -
Import Collection: Import the collection from
pb_schema.jsonby navigating to Settings > Import Collections.Important: Ensure you select the "Merge with existing collections" option during the import process.
-
Configure Metadata: Create new records in the
hnbc_metacollection:-
botToken: Enter your Telegram Bot Token. -
channelId: Specify the Telegram channel where the bot should post new comments.
-
The bot operates using two cron jobs:
-
Comment Retrieval: Every 15 minutes, the bot pulls fresh comments from Hacker News and saves them to the
hnbccollection. -
Posting Comments: Every 5 minutes, the bot retrieves 5 unpublished comments from the
hnbccollection and posts them to the specified Telegram channel.