@ -12,6 +12,12 @@ Yay! **Working examples** say more than a 1000 words:
Execute through `yarn toot` or `yarn node src/chat.js`. It cycles through all configured "buddies" and toots a message accordingly. Use your favorite `crontab` timestamp to fire off toots automatically.
If you'd like to let a specific buddy chat - for instance to configure them individually in your crontab - use the argument `buddy`:
`yarn toot --buddy [by-cool-buddy]`
The name shouldl match the `buddy` property in the config file (_not_ the `name` property: that's the buddy directory name).
### Packaged buddies
1. **animalcrossing**: collect data from https://animalcrossing.fandom.com/wiki/ and randomly toot about a villager, including a link to the fandom and the birthday. Uses dirty scraping, no rate limit hit yet...
@ -40,6 +46,7 @@ See `config.sample.js`. A config file should expose `buddies` as an array with t
name: "buddyname", // same as the dir name
buddy: "my cool buddy", // unique buddy id
instance: "https://mastodon.social", // where to post to
oauthToken: "my-token" // the oauth token for that server/user to post the status with
@ -47,6 +54,8 @@ See `config.sample.js`. A config file should expose `buddies` as an array with t
Optional config flags can be used in the chat function if desired.
There's a sanity check implemented: at minimum, each config should have name, buddy, instance, and oauthToken present.
## How to get an OAuth token from a Masto?Pleroma instance?
I've prepared a few utility functions in `registerApp.js` for you. First, call `await register()`, which prints an URL to go to. Next, fill in the client id, secret, and returned token, after granting the app access to read and write. Then, call `await fetchToken()`. Paste that token in the config file. Done!