- scrape news from 🌐 school site (https://zseis.zgora.pl/)
- send them trought 🐱💻 Discord Webhooks
- doesn't require hosting as it uses GitHub Actions
- You can't get id of entry in easy way (to my knowledge other than brute-forcing), so script generates a checksum (
md5(title + dateModified)
) to check what news were already sent to Discord - Script has hard-coded that there are 4 news per page and will throw error if will find more, this is due to not well structured HTML of website. This also leads to news extracter seem to be a bit unintuitive.
- It uses Discord Webhooks and requires function in other bot to crosspost on announcement channel.
git clone https://github.com/konhi/zseis-news.git
cd zseis-news
echo WEBHOOK_URL="<https://discord.com/api/webhooks/xxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxx" > .env
npm install
npm run start
: builds and runs the scriptnpm run test
: code testing using jestnpm run lint
: automatically fix problems and show style errorsnpm run dev
: TypeScript compiler watch for changesnode dist/main.js
: run main program (without compiling)