any free tablebase web service?

Discussion of anything and everything relating to chess playing software and machines.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
casaschi
Posts: 164
Joined: Wed Dec 23, 2009 12:57 pm

any free tablebase web service?

Post by casaschi » Fri Sep 09, 2011 9:45 pm

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.

tmokonen
Posts: 1037
Joined: Sun Mar 12, 2006 5:46 pm
Location: Vancouver

Re: any free tablebase web service?

Post by tmokonen » Sun Sep 11, 2011 4:42 am

Would something like the JavaScript SOAP client prove useful to you?

http://www.codeproject.com/KB/ajax/Java ... lient.aspx

casaschi
Posts: 164
Joined: Wed Dec 23, 2009 12:57 pm

Re: any free tablebase web service?

Post by casaschi » Sun Sep 11, 2011 5:18 am

tmokonen wrote:Would something like the JavaScript SOAP client prove useful to you?

http://www.codeproject.com/KB/ajax/Java ... lient.aspx
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.

casaschi
Posts: 164
Joined: Wed Dec 23, 2009 12:57 pm

Re: any free tablebase web service?

Post by casaschi » Sun Sep 11, 2011 8:51 pm

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).

Code: Select all

<script>

function probeFen&#40;fenString&#41; &#123;
   probeTablebaseXMLHTTPRequest = new XMLHttpRequest&#40;);
   probeTablebaseXMLHTTPRequest.open&#40;"POST", "http&#58;//www.lokasoft.nl/tbweb/tbapi.asp", true&#41;;
   probeTablebaseXMLHTTPRequest.setRequestHeader&#40;"Content-Type", "text/xml; charset=utf-8");
   probeTablebaseXMLHTTPRequest.setRequestHeader&#40;"SOAPAction", "http&#58;//lokasoft.org/action/TB2ComObj.ProbePosition");
   probeTablebaseXMLHTTPRequest.onreadystatechange = function&#40;) &#123;
      if &#40;probeTablebaseXMLHTTPRequest.readyState == 4&#41; &#123;
         if &#40;probeTablebaseXMLHTTPRequest.status == 200&#41; &#123;
            if &#40;matches = probeTablebaseXMLHTTPRequest.responseText.match&#40;/<SOAP-ENV&#58;Body><m&#58;ProbePositionResponse xmlns&#58;m="http&#58;\/\/lokasoft.org\/message\/"><Result>(&#91;0-9M-&#93;*)<\/Result><\/m&#58;ProbePositionResponse>/)) &#123;
               alert&#40;matches&#91;1&#93;);
            &#125;
         &#125;
      &#125;
   &#125;;
   request = '<SOAP-ENV&#58;Envelope xmlns&#58;ns3="http&#58;//www.w3.org/2001/XMLSchema" xmlns&#58;SOAP-ENC="http&#58;//schemas.xmlsoap.org/soap/encoding/" xmlns&#58;ns0="http&#58;//schemas.xmlsoap.org/soap/encoding/" xmlns&#58;ns1="http&#58;//lokasoft.org/message/" xmlns&#58;ns2="http&#58;//schemas.xmlsoap.org/soap/envelope/" xmlns&#58;xsi="http&#58;//www.w3.org/2001/XMLSchema-instance" xmlns&#58;SOAP-ENV="http&#58;//schemas.xmlsoap.org/soap/envelope/" SOAP-ENV&#58;encodingStyle="http&#58;//schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV&#58;Header/><ns2&#58;Body><ns1&#58;ProbePosition><fen xsi&#58;type="ns3&#58;string">' + fenString + '</fen></ns1&#58;ProbePosition></ns2&#58;Body></SOAP-ENV&#58;Envelope>';
   probeTablebaseXMLHTTPRequest.send&#40;request&#41;;
&#125;

probeFen&#40;"8/8/8/8/1p2P3/1k1KP3/8/8 w - - 0 1");

</script>

Gino Figlio
Posts: 88
Joined: Sun Jan 10, 2010 5:10 am
Location: Lamar, Colorado, USA

Re: any free tablebase web service?

Post by Gino Figlio » Sun Sep 11, 2011 11:24 pm

This site has the 6-piece tablebases:

http://www.k4it.de/index.php?topic=egtb&lang=en

casaschi
Posts: 164
Joined: Wed Dec 23, 2009 12:57 pm

Re: any free tablebase web service?

Post by casaschi » Sun Sep 11, 2011 11:29 pm

Gino Figlio wrote:This site has the 6-piece tablebases:

http://www.k4it.de/index.php?topic=egtb&lang=en
True, but they offer only a web browser interface.
Instead, I need a programmer interface for my google chrome extension to get the assessment of a given FEN position using javascript.

Gino Figlio
Posts: 88
Joined: Sun Jan 10, 2010 5:10 am
Location: Lamar, Colorado, USA

Re: any free tablebase web service?

Post by Gino Figlio » Sun Sep 11, 2011 11:35 pm

I don't have the background to understand what you need. I thought you could create a script to query the site

tano-urayoan
Posts: 638
Joined: Thu Aug 30, 2007 6:23 pm
Location: San Juan, Puerto Rico

Re: any free tablebase web service?

Post by tano-urayoan » Mon Sep 12, 2011 1:08 am

What about this site, http://chessok.com/?page_id=361 ? It has 6 pieces tablebases.

casaschi
Posts: 164
Joined: Wed Dec 23, 2009 12:57 pm

Re: any free tablebase web service?

Post by casaschi » Mon Sep 12, 2011 5:59 am

tano-urayoan wrote:What about this site, http://chessok.com/?page_id=361 ? It has 6 pieces tablebases.
This one also offers only a web browser interface without a progamming inerface.
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.

Post Reply