Playground for experimenting with custom client code for itch.io
- TypeScript 100%
| .idea | ||
| src | ||
| .gitignore | ||
| package-lock.json | ||
| package.json | ||
| readme.md | ||
| tsconfig.json | ||
itch-client-stuff
Getting Started
- Log into itch.io using a web browser, and use dev tools to capture the cookies being sent. You're specifically looking for
itchio,itchio_id, anditchio_token. - Create a file
src/secrets.tsand enterexport const cookie = 'YOUR COOKIES HERE';. Do not ever share this file, as the cookie grants full access to your account! - Run
npm installto install dependencies. - Run
npm run runto run the tool. (yes that's two "run"s - it's not a typo!)
Repo overview
src/index.ts- main entry point.src/itch.ts- implements useItch() function for building simple scripts based on common logic.src/secrets.ts- storage for any secrets that should not be commited to git.src/data3.ts- implementation of Data3, a custom flat-file KV database. (check the git history to see what happened to Data2 and Data(1))src/client.ts- itch.io API client. Uses a mix of REST APIs and HTML scraping to obtain data.src/filter.ts- programmable filter utility. Not fully implemented, but will eventually be used to progressively build filters from the UI.src/util/*- static utility functions.src/util/stringUtils.ts- unicode hell.src/model/*- "model" classes, which implement a typed repository model over Data3 stores.src/model/model.ts- base class for all models, extend this if adding a new model type.
Yeah and that's about it, for now.
There's no UI yet so just add whatever filters you want in the bottom part of index.ts, and npm run nun will automatically build your changes.