How to post chess games

General discussion about computer chess...

Re: How to post chess games

Postby pgn4web » Thu Apr 28, 2016 3:32 pm

H.G.Muller wrote:I thought that things like CGI and PHP were absolutely standard in HTTP servers nowadays. It is clear that people who want to broadcast should have access to some server machine. It wouldn't be anymore difficult to upload a PHP or CGI file than to upload a PGN file.

Uploading a file is not the issue. Making sure that the CGI/PHP script executes flawless is a bit more tricky, think about different versions of PHP and different PHP server configuration settings. Probably more to do with my inexperience than with anything else, but I have some php script in the pgn4web package that did have some problem running on different servers than the couple I tested with. Small stuff, but annoying enough to discourage people without much experience and really looking for something that just works.
pgn4web
 
Posts: 97
Joined: Mon Jun 14, 2010 10:26 pm

Re: How to post chess games

Postby Rebel » Thu Apr 28, 2016 4:37 pm

I found a different way using FTP.EXE as found in the Windows directory.

http://www.top-5000.nl/pgn4web/live.htm

Still under construction, but it seem to work.

I run:
Code: Select all
ftp -s:script.txt ftp.top-5000.nl


script.txt
Code: Select all
top-5000.nl
password
cd pgn4web
put c:\arena\arena1.pgn
quit


PS, page is currently refreshed every 5 seconds.
User avatar
Rebel
 
Posts: 514
Joined: Wed Jun 09, 2010 7:45 pm

Re: How to post chess games

Postby mjlef » Sat Apr 30, 2016 5:01 am

Ed,

There is a small typo near the bottom of that page. You have "Odro" instead of "Ordo".

This will be great to follow the games.

Mark
mjlef
 
Posts: 41
Joined: Thu Jun 10, 2010 6:51 pm

Re: How to post chess games

Postby Rebel » Sat Apr 30, 2016 2:29 pm

The only good bug is a dead bug.
-- DD
User avatar
Rebel
 
Posts: 514
Joined: Wed Jun 09, 2010 7:45 pm

Re: How to post chess games

Postby Rebel » Thu May 05, 2016 10:59 am

pgn4web wrote:Relying on a standard tool like FTP makes the whole thing easier to setup

Indeed.

It was an easy set-up after all.

Most of the time went into the things Arena was supposed to do, but didn't.

[Wish] - could you add EPD support as shown here on top of the board? People then can paste the current position into their favorite engine for analysis.
User avatar
Rebel
 
Posts: 514
Joined: Wed Jun 09, 2010 7:45 pm

Re: How to post chess games

Postby pgn4web » Thu May 05, 2016 11:21 am

Rebel wrote:could you add EPD support as shown here on top of the board? People then can paste the current position into their favorite engine for analysis.

If you click on square B8 you get a popup where you can copy the FEN string of the current position or the PGN of the game starting from the current position. That is good enough for the cut&paste requirement.

Not too difficult either to add the FEN string in an HTML element:
Add somewhere in your page this HTML:
Code: Select all
<div id="CurrentPositionFEN"></div>

then add this javascript code:
Code: Select all
function customFunctionOnMove() {
  var theObj = document.getElementById("CurrentPositionFEN");
  if (theObj) { theObj.innerHTML = CurrentFEN(); }
}

At every move the HTML element should be automatically updated to the FEN string of the current position.

Typing this without testing, so hopefully not too many typing errors...
pgn4web
 
Posts: 97
Joined: Mon Jun 14, 2010 10:26 pm

Re: How to post chess games

Postby H.G.Muller » Thu May 05, 2016 1:20 pm

Rebel wrote:
pgn4web wrote:Relying on a standard tool like FTP makes the whole thing easier to setup

Indeed.

It was an easy set-up after all.

Well, that is not my experience. From a Windows machine ftp often fails to work when I want to upload something to a Linux machine. It seems the newer Linux ftp servers can only work with clients that are in 'passive' mode. And the ftp that comes with Windows does seem to not support that command. So usually ftp just hangs without doing anything, even when I try something as simple as a DIR command.

I prefer solutions that work 'out of the box', without relying on any external software that the user might or might not have, and that might or might not do what you want. Ftp would definitely be on my blacklist.
H.G.Muller
 
Posts: 161
Joined: Sun Jul 14, 2013 10:00 am

Re: How to post chess games

Postby Rebel » Thu May 05, 2016 4:49 pm

pgn4web wrote:
Rebel wrote:could you add EPD support as shown here on top of the board? People then can paste the current position into their favorite engine for analysis.

If you click on square B8 you get a popup where you can copy the FEN string of the current position or the PGN of the game starting from the current position. That is good enough for the cut&paste requirement.

Not too difficult either to add the FEN string in an HTML element:
Add somewhere in your page this HTML:
Code: Select all
<div id="CurrentPositionFEN"></div>

then add this javascript code:
Code: Select all
function customFunctionOnMove() {
  var theObj = document.getElementById("CurrentPositionFEN");
  if (theObj) { theObj.innerHTML = CurrentFEN(); }
}

At every move the HTML element should be automatically updated to the FEN string of the current position.

Typing this without testing, so hopefully not too many typing errors...

Thank you, works like a charm.
User avatar
Rebel
 
Posts: 514
Joined: Wed Jun 09, 2010 7:45 pm

Re: How to post chess games

Postby hyatt » Fri May 06, 2016 4:26 am

H.G.Muller wrote:
Rebel wrote:
pgn4web wrote:Relying on a standard tool like FTP makes the whole thing easier to setup

Indeed.

It was an easy set-up after all.

Well, that is not my experience. From a Windows machine ftp often fails to work when I want to upload something to a Linux machine. It seems the newer Linux ftp servers can only work with clients that are in 'passive' mode. And the ftp that comes with Windows does seem to not support that command. So usually ftp just hangs without doing anything, even when I try something as simple as a DIR command.

I prefer solutions that work 'out of the box', without relying on any external software that the user might or might not have, and that might or might not do what you want. Ftp would definitely be on my blacklist.



Linux ftp servers don't have this problem. It is usually a firewall problem. In passive mode, ftp uses the same connection socket to send data and commands. And since the client end originates the connection, he can be behind a firewall, or a router that is using NAT, and all works well. But if you use non-passive mode, the server end has to open a connection to the client machine to actually send the data. And if the client is behind a firewall or a router that is doing NAT, this is impossible and the connection appears to hang. Since NAT uses fake port renumbering to work, it is impossible to open a connection to a client behind such a firewall/router unless you get really clever with port forwarding settings on the firewall/router.

passive mode solves all of this...
hyatt
 
Posts: 1242
Joined: Thu Jun 10, 2010 2:13 am
Location: University of Alabama at Birmingham

Re: How to post chess games

Postby Rebel » Thu May 19, 2016 9:06 am

Paolo, maybe you can help me with the last glitch before I make the applet public. If you go to 1 of the 4 live channels then you will notice that often (usually with draws) the script refuses to go to the next game. I have PGN4WEB initialized as follows:

Code: Select all
<script type="text/javascript">
SetPgnUrl("http://rebel13.nl/pgn4web/arena1.pgn");
   SetImagePath ("alpha/36");
   SetImageType("png");
   SetGameSelectorOptions("Select a game...", false, 8, 8, 0, 8, 8, 8, 10); // (head, num, chEvent, chSite, chRound, chWhite, chBlack, chResult, chDate);
   SetCommentsOnSeparateLines(false);
//   SetAutoplayDelay(500); // milliseconds
   SetAutostartAutoplay(true);
   SetAutoplayNextGame(true);
   SetInitialGame("last");
   SetShortcutKeysEnabled(false);
   SetInitialHalfmove("end", true),
SetLiveBroadcast(0.01, false, false, false, false);
 </script>

Is there a way to fix it?
User avatar
Rebel
 
Posts: 514
Joined: Wed Jun 09, 2010 7:45 pm

PreviousNext

Return to General Topics

Who is online

Users browsing this forum: No registered users and 2 guests