Skip to content

This Telegram bot shares the latest Farcaster posts containing a tracked keyword.

License

Notifications You must be signed in to change notification settings

mozrt2/farcaster-keyword-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Farcaster Keyword Bot

Screenshot

This Telegram bot shares the latest Farcaster posts containing a tracked keyword. It is built on top of the fantastic Searchcaster API.

Setup

a. Clone this repository.

git clone <repository-url>

b. Navigate to the project directory.

cd farcaster-keyword-bot

c. Install the required dependencies.

yarn install

d. Create a .env file in the root directory of the project and add your Telegram Bot API token and Telegram Channel ID.

TELEGRAM_API_TOKEN=your-telegram-bot-api-token
TELEGRAM_CHAT_ID=your-telegram-channel-id

To get the Telegram Bot API token, create a new bot on Telegram using @BotFather. This guide breaks down the step by step process. Make sure to also add the bot to the Telegram channel in which you want to receive the updates.

To get the Telegram Channel ID, open web.telegram.org on a desktop browser and navigate to the channel. The URL will have the following format web.telegram.org/a/#TELEGRAM_CHAT_ID.

e. Replace the keywords array in index.js with your own keywords.

const keywords = [
  'wowow',
  'stated preference',
  'revealed preference',
];

f. Adjust the checkEveryMin variable in index.js to match your cron job schedule.

const checkEveryMin = 30;

Testing the Bot

To test the bot, use the following command:

node local-test.js

The bot will now fetch recent posts from Searchcaster based on your keywords and send these posts to your Telegram channel.

Deploying the Bot

This project was set up and tested with Vercel cron jobs. It should seamlessly work with other cron services.

License

This project is open source and licensed under the MIT License.

About

This Telegram bot shares the latest Farcaster posts containing a tracked keyword.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published