What's this?
If you play animal crossing, especially the new horizons you may have the seen the character Daisy Mae. She sells you turnips which you can later sell. To improve your results you may want to track the prices. That caused the website stalks.io. It allows you to track the prices and show you a predicition.
If you happen to be patron of this at level 2 you can use the api to interact with the page. This library/module allows you to easily interact with the api via node or deno.
Documentaion
You find a full documentation over here.
Installation
If you want to use node you just need to install it via:
$ npm install stalks.js
Loading the library/modules
For node:
import StalksClient from "stalks.js";
You can't use require. stalks.js is a pure ES Module. You still can use the dynamic import().
For deno:
import StalksClient from "https://raw.githubusercontent.com/cptpiepmatz/stalks.js/master/mod.ts";
Usage
Some basic usage for this.
const client = new StalksClient(YOUR_API_TOKEN);
const stalks = client.stalks;
const accounts = client.accounts;
stalks.fetchWeek()
.then(console.log)
.catch(console.error);
accounts.fetchCurrentUser()
.then(console.log)
.catch(console.error);
Getting an API token
- Become a patron.
- Go to stalks.io patron page.
- Choose at least "Blathers".
- Go to stalks.io settings.
- Click on "API Access".
- There you go. You have your token. (You may need to regenerate one.)
Examples
You can find examples here.