TcecEvaluationBot icon indicating copy to clipboard operation
TcecEvaluationBot copied to clipboard

Improve !cdb parsing

Open noobpwnftw opened this issue 4 years ago • 2 comments

Text format API has '\0' at end of line for legacy purposes, modern applications can make use of json output by adding &json=1 to the request here: https://github.com/NikolayIT/TcecEvaluationBot/blob/08d287bb833e601a170c84f112d933f781803f5c/src/TcecEvaluationBot.ConsoleUI/Services/ChessDbcnScoreProvider.cs#L34

which will result in responses like this: https://www.chessdb.cn/cdb.php?action=queryall&learn=1&showall=1&board=rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR%20w%20KQkq%20-%200%201&json=1 Results will have moves in SAN notations which simplifies this: https://github.com/NikolayIT/TcecEvaluationBot/blob/08d287bb833e601a170c84f112d933f781803f5c/src/TcecEvaluationBot.ConsoleUI/Services/ChessDbcnScoreProvider.cs#L94-L96

noobpwnftw avatar Jan 30 '21 21:01 noobpwnftw

In case you have the time, can you send a pull request so I can merge the changes :)

NikolayIT avatar Jan 31 '21 00:01 NikolayIT

Local conversion has ambiguity bugs like "Nbd2" show as "Nd2" in this position: r1bqkb1r/pp2pppp/2nP4/8/4n3/5N2/PPP2PPP/RNBQKB1R w KQkq - 1 6

noobpwnftw avatar May 25 '21 00:05 noobpwnftw