@aberoth-community/overheard

@aberoth-community/overheard

Discord GitHub Actions Workflow Status NPM Version GitHubStars

A simple & portable "Aberoth Overheard" scraper library and cli.

client ...
npm npm i @aberoth-community/overheard
pnpm pnpm i @aberoth-community/overheard
yarn yarn add @aberoth-community/overheard

(See: Releases)

For convenience overheard can also be downloaded as a standalone executable.

$ ./overheard --help
Usage: overheard [options]

Options:
-h, --header [values...] add request headers.
-i, --interval <int> set scan interval.
-v, --version output the version number
--help display help for command

(See: Api-Docs, examples/webhook.js)

import Overheard from '@aberoth-community/overheard'

// main
void (async () => {
const overheard = new Overheard(
// scraper options
{ headers: {}, interval: 30e3 },
// scraper cache (optional)
{
online: 50,
moon: 'full',
realms: {
[Overheard.OVERHEARD_SCHOOLS.yellow]: 'dark',
},
},
)

// start the scraper loop
overheard.start()
// stop scraper
overheard.stop()

// === events ===
overheard.addEventListener('error', (event) => {
console.error(event.error)
})
overheard.addEventListener('exit', (event) => {
console.log('exit!')
})
overheard.addEventListener('moon', (event) => {
console.log(`moon: ${event.phase}`)
})
overheard.addEventListener('realm', (event) => {
console.log(`scroll: ${event.name} ${event.phase}`)
})

// === getters ===
console.log(overheard.getRealms()) // [{ name: 'white', school: 'divination', phase: 'dark' }, ...]
console.log(overheard.getMoon()) // nearly_full
console.log(overheard.getOnline()) // 100
})()