Using QStat with a Web Page

I get lots of questions about how to put QStat on a web page. This can be done one of two ways. Have a program run periodically that creates a new web page based on the output of QStat. Or run a script or program when someone loads your page. The first style can be done on existing operating systems, but requires that you be able to run a program on the web server, even when you aren't on-line. Most ISPs don't allow this.

The second style involves web programming, also known as CGI programming. I've never done any CGI programming, so I can't offer specific help.

The QStat Derived Works page lists a couple packages that help turn QStat output into HTML.

I've done a little research and found several web pages with CGI programming tutorials. Good luck!

QStat features for web pages

Output Templates

QStat can generate custom formatted output using templates. This is ideal for generating web pages. The template/ directory in the QStat distribution includes some examples. The examples are admittedly poor, but they should get you started. The QStat docs provide full details on the output template syntax.

Raw mode

The QStat -raw flag is intended for use by server-side web programmers (ie. perl). Adding the flag -raw delimeter to your qstat command causes the output fields to be separated by delimeter. Try the command by hand to see how it works. To avoid conflicts between your delimiter and similar characters in server and player names, use a multi-character delimiter. Complete details on the -raw flag and related flags can found in the QStat documentation.

Steve Jankowski
steve@qstat.org