Hello,
is anyone aware of any free tablebase web service that I could use in an open source GPL project (an extension for google chrome)?
What I'm looking for is a service that I could query (with javascript from my extension) sending a probe request with a FEN string as a parameter and receiving back the tablebase lookup result (mate in X, draw, position not found, error).
There's something here http://www.lokasoft.nl/tbapi.aspx but I could not make the SOAP request work with javascript. Other services like the one at the shredder website only allow manually entering the FEN string.
Thanks.
any free tablebase web service?
Moderators: hgm, Rebel, chrisw
-
- Posts: 1296
- Joined: Sun Mar 12, 2006 6:46 pm
- Location: Kelowna
- Full name: Tony Mokonen
Re: any free tablebase web service?
Would something like the JavaScript SOAP client prove useful to you?
http://www.codeproject.com/KB/ajax/Java ... lient.aspx
http://www.codeproject.com/KB/ajax/Java ... lient.aspx
-
- Posts: 164
- Joined: Wed Dec 23, 2009 1:57 pm
Re: any free tablebase web service?
I already tried using this library to access the lokasoft server, but I could not get it to work (and it's not a cross domain issue since google chrome extensions are allowed cross domain requests); I posted a note for the author of the library but I got no reply.tmokonen wrote:Would something like the JavaScript SOAP client prove useful to you?
http://www.codeproject.com/KB/ajax/Java ... lient.aspx
-
- Posts: 164
- Joined: Wed Dec 23, 2009 1:57 pm
Re: any free tablebase web service?
Finally managed to manually build a SOAP query for the lokasoft server.
Posting the code below if anyone is interested.
Still it would be great to have an alternative, possibly supporting 6 men tables (the lokasoft server seems limited to 5 men).
Posting the code below if anyone is interested.
Still it would be great to have an alternative, possibly supporting 6 men tables (the lokasoft server seems limited to 5 men).
Code: Select all
<script>
function probeFen(fenString) {
probeTablebaseXMLHTTPRequest = new XMLHttpRequest();
probeTablebaseXMLHTTPRequest.open("POST", "http://www.lokasoft.nl/tbweb/tbapi.asp", true);
probeTablebaseXMLHTTPRequest.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
probeTablebaseXMLHTTPRequest.setRequestHeader("SOAPAction", "http://lokasoft.org/action/TB2ComObj.ProbePosition");
probeTablebaseXMLHTTPRequest.onreadystatechange = function() {
if (probeTablebaseXMLHTTPRequest.readyState == 4) {
if (probeTablebaseXMLHTTPRequest.status == 200) {
if (matches = probeTablebaseXMLHTTPRequest.responseText.match(/<SOAP-ENV:Body><m:ProbePositionResponse xmlns:m="http:\/\/lokasoft.org\/message\/"><Result>([0-9M-]*)<\/Result><\/m:ProbePositionResponse>/)) {
alert(matches[1]);
}
}
}
};
request = '<SOAP-ENV:Envelope xmlns:ns3="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns0="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://lokasoft.org/message/" xmlns:ns2="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Header/><ns2:Body><ns1:ProbePosition><fen xsi:type="ns3:string">' + fenString + '</fen></ns1:ProbePosition></ns2:Body></SOAP-ENV:Envelope>';
probeTablebaseXMLHTTPRequest.send(request);
}
probeFen("8/8/8/8/1p2P3/1k1KP3/8/8 w - - 0 1");
</script>
-
- Posts: 95
- Joined: Sun Jan 10, 2010 6:10 am
- Location: Lamar, Colorado, USA
-
- Posts: 164
- Joined: Wed Dec 23, 2009 1:57 pm
Re: any free tablebase web service?
True, but they offer only a web browser interface.Gino Figlio wrote:This site has the 6-piece tablebases:
http://www.k4it.de/index.php?topic=egtb&lang=en
Instead, I need a programmer interface for my google chrome extension to get the assessment of a given FEN position using javascript.
-
- Posts: 95
- Joined: Sun Jan 10, 2010 6:10 am
- Location: Lamar, Colorado, USA
Re: any free tablebase web service?
I don't have the background to understand what you need. I thought you could create a script to query the site
-
- Posts: 638
- Joined: Thu Aug 30, 2007 8:23 pm
- Location: San Juan, Puerto Rico
Re: any free tablebase web service?
What about this site, http://chessok.com/?page_id=361 ? It has 6 pieces tablebases.
-
- Posts: 164
- Joined: Wed Dec 23, 2009 1:57 pm
Re: any free tablebase web service?
This one also offers only a web browser interface without a progamming inerface.tano-urayoan wrote:What about this site, http://chessok.com/?page_id=361 ? It has 6 pieces tablebases.
Looking in details how that page is built, there's a hook that could be used by a javascript program, however if chessok does not formally offer a public/free API I don't think that hook could be used without permission.