FujoWebDev / AO3.js

NodeJS API for scraping AO3 data
MIT License
15 stars 8 forks source link

user.ts can now fetch everything listed in #10 #12

Closed cyrusae closed 1 year ago

cyrusae commented 2 years ago

See #10

Nontrivial possibility I erred too far on the other side of "make pull requests modular" but in my defense I kept meaning to take a break and instead it's like potato chips over here

cyrusae commented 2 years ago

Note: added additional test using user Alasdair5000 because he's unlikely to write more fic/bookmark anything/etc.; however, also added note in test that tests may fail if the user has updated their bio/etc. without the code itself being wrong, so people know what to troubleshoot if that happens.

essential-randomness commented 2 years ago

Note: added additional test using user Alasdair5000 because he's unlikely to write more fic/bookmark anything/etc.; however, also added note in test that tests may fail if the user has updated their bio/etc. without the code itself being wrong, so people know what to troubleshoot if that happens.

Eheh, that makes sense. In theory we could fake loading the HTML and simply run tests with cached pages so there's no risk of change. Then we could write more tests to e.g. once a day check that the HTML hasn't changed in a way that makes our other tests fail.

We should probably do that. Might be worth opening up an issue for it (we can discuss what I mean/what the design would be on the Discord).

cyrusae commented 2 years ago

Changed hardcoded numbers to internally-explained constants for stripping the non-numerical data from the navigation menu info.