A Smart Semi-automatic Activity Notifier for HackMD
python -m venv venv
source ./venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txtIn this project, we use HackMD API and Discord Webhook URL to create a bot that notifies users about their activities on HackMD.
To use the bot, you need to create an API token on HackMD and a Webhook URL on Discord.
If use want to run the script locally, you need to create a .env file in the root directory with the following content:
HACKMD_API_KEY="xxx"
DISCORD_WEBHOOK_URL="xxx"
You can copy the
.env.examplefile and rename it to.envto set the environment variables.
- Go to HackMD and login
- Click on
Settings->API->Create API Token - Type a name for the token and click on
Create - Copy the token and save it in the
.envfile
- Go to Server Settings -> Integrations -> Webhooks -> New Webhook
- Copy the Webhook URL and save it in the
.envfile
You can run the script using the following command:
python checkHackmdUpdates.pyNote: You need to set the
HACKMD_API_KEYandDISCORD_WEBHOOK_URLenvironment variables before running the script. It will send a message to your Discord channel with the latest updates on your HackMD documents.
The script will be deployed using GitHub Actions. You need to set the HACKMD_API_KEY, DISCORD_WEBHOOK_URL, and PAT(Personal Access Token) secrets in the repository settings.
Repository->Settings->Secrets and variables->Actions- Click on
New repository secret - Create a secret with the name
HACKMD_API_KEYand paste the API token - Create a secret with the name
DISCORD_WEBHOOK_URLand paste the Webhook URL
- Go to GitHub and login
- Click on
Settings->Developer settings->Personal access tokens->Generate new token - Copy the token and save it in the repository secrets (
PAT)