The guild events URL https://eu.battle.net/wow/en/vault/character/event doesn't exist anymore.
This WebHook sends new guild events to a Discord channel.
Since Blizzard still does not offer in its public API the ability to retrieve data from the guild calendar , this project scrapes the page: https://eu.battle.net/wow/en/vault/character/event to get the guild events.
- Puppeteer go to
https://eu.battle.net/wow/en/vault/character/event
- Log in using
BLIZZARD_EMAIL
andBLIZZARD_PASSWORD
environment variables
- Scrap all the
.event-summary
li element
- Filter guild events with the
getGuildEvents()
function - Save the events under an
events.json
file, if the file does not exist it assumes it's the first crawl and it will sends ALL the current events to catch up - Wait for the interval
- Crawl again, diff between the
events.json
and the new JSON and send ONLY the new events - Repeat
DISCORD_WEBHOOK_URL
Events will be POSTed at this URLBLIZZARD_EMAIL
Needed to log in to the events pageBLIZZARD_PASSWORD
Needed to log in to the events pageGUILD_NAME
It is used for the Discord embed messageGUILD_THUMBNAIL_URL
It is used for the Discord embed thumbnailINTERVAL
It will run the crawl everyINTERVAL
minutesDEV
If set to a truthy value it will run Puppeteer in headful mode and it will not send requests to the WebHook (only print them in the console)
- Clone the repo
yarn
ornpm install
npm run start
to run the bot oncenpm run dev
will build watch and run nodemon
npm run test
or npm run test:watch