devjiwonchoi / equine Goto Github PK
View Code? Open in Web Editor NEWMinimal Lichess API Client for Node.js
Home Page: https://equine.vercel.app
License: MIT License
Minimal Lichess API Client for Node.js
Home Page: https://equine.vercel.app
License: MIT License
Use native fetch instead of node-fetch
Hi,
Hope you're doing great. I wanted to ask whether you're open to contributions, and whether the following additions you'd consider useful:
If all, or some of these, are interesting to you, I'd be happy to implement them. I already have some of the code for my personal project. If not, of course, no worries.
And, lastly, I'd like to ask whether there are any contribution guidelines, standards you'd like pull requests to meet (tests, coding style, whatever).
Hope all is good with you, cheers!
Lukas
/api
The LICHESS_API_URL
constant starts with /api
, which I am assuming is for convenience. This means that any provided endpoint must start with /api
to be used by the fetcher. However, while working on the Study API, I noticed that the study.studies()
method is not compatible with the current fetcher structure because its endpoint does not start with /api
.
Moreover, the study.chapter()
and study.chapters()
methods return PGN, which is in string format. These responses cannot be JSON parsed. The current fetcher implementation always parses the response as JSON, which means that these methods are also not compatible with the current fetcher.
In order to support these exceptions in the current fetcher, and to be more futureproof, why don't we add an additional parameter fetchOptions
to the fetcher? Here, we can define a custom API url (in case it does not start with the lichess API url, for example), state whether the response should be parsed through JSON, or, perhaps in the future, whether the response is in nd-json format and needs to be streamed instead. I can self-assign this issue (with your approval, of course) since I am already busy with the Study API.
// berserk
client.users.get_realtime_statuses ✅
client.users.get_all_top_10 ✅
client.users.get_leaderboard ✅
client.users.get_public_data ✅
client.users.get_activity_feed ✅
client.users.get_by_id ✅
client.users.get_by_team ❓
client.users.get_live_streamers ✅
client.users.get_rating_history ✅
client.users.get_crosstable ✅
client.users.get_user_performance ✅
I'm able to get some meta data by FEN, such as opening name, # of games and win %, but I would like to construct a list of relevant links to games on lichess. This appears to be done by server-side functions on the lichens.org web site.
I'm willing to contribute if I can be pointed in the right direction.
Some methods take a single param as an object and some takes as multiple.
Convert all to take as an object, with consistent naming.
Maybe with nextra?
Currently, we are using my own account devjiwonchoi
and devjiwonchoi_equine
to test the assets. We should find a better way to test this.
I'm assuming that by adding challenge
, we'll be able to test against board
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.