NOTE ABOUT ALL OF THE BELOW: -------------------- These instructions are about setting up Juhana's IF Recorder so that you can host an Inform game or games on your webspace and have transcripts of all plays of them recorded automatically to a MYSQL database, also on your webspace. IF Recorder dates back to 2010/2011 and ultimately was found not to work on its own today (Dec 2021). Dannii made a hack of one file and got it working with Glkote in Dec 2021. These instructions include the adding of his hack and a mountain of other fiddly stuff required to make it work. But it does work. Will it work the same with Dannii's replacement Glkote that he just announced? I don't know. The instructions skew a bit Mac, since I'm using one, but just use your own command line program whenever I say 'Terminal'. Plus you'll need to know some Unix commands for moving around your file directories and checking their contents; these are easy to Google. You'll also need your own webspace and access to a MySql database on it (ideally the basic one provided by CPanel) but you don't need to know much about MySql itself. You'll also need to have installed Git on your home machine (https://github.com/git-guides/install-git) and NPM (https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) If you've done/got all the above, you can try to stagger onwards through the following instructions, the way I did while assembling them. -------------------- First, install Parchment in your github directory (or wherever else you're going to set this up on your computer) like this: Navigate there, then type git clone https://github.com/curiousdannii/parchment parchment to copy contents to a new local folder called parchment Now you need to get Parchment's upstream content, as per Building Instructions (on https://github.com/curiousdannii/parchment) Move into parchment directory, then type: sudo git submodule update --init --recursive Next: sudo npm install - Next, download 'parchment-for-inform7.zip' from the link on this page: https://github.com/curiousdannii/parchment - then place it, still zipped, in the parchment folder. Now download if-recorder-tools.3.0.zip from if-recorder downloads page: https://github.com/juhana/if-recorder/downloads Note that the other files you see there are not needed! if-recorder-client.3.0.zip IS NO LONGER NEEDED! inform7-template.3.0.zip IS NOT NEEDED! Unzip if-recorder-tools.3.0.zip. - Move its contents (include, viewer and server directories) into the tools directory in the parchment folder. Now, the server directory (containing sav-sql.php) is out of date with Glkote. Dannii hacked a fix for this in 2021. To get the hack, go to the following directory - https://github.com/curiousdannii/if-recorder/blob/glkote/tools/server/save-sql.php - and right-click Raw, and download save-sql.php. Copy this file over the one currently in your parchment/tools/server folder -------------------- Now you need the script that builds games as sites. This is Zarf's python script called ifsitegen.py which is at https://github.com/erkyrath/glk-dev/blob/master/ifsitegen.py I just clicked 'raw' then copy-pasted the contents into a BBEdit file and saved it as ifsitegen.py Put this script in the parchment folder, too, for handiness. When using this script, THE GAME FILE NAME CAN'T CONTAIN SPACES OR APOSTROPHES, ETC. Proceeding using case of six.gblorb: Put the game in the parchment folder. Navigate into the parchment folder. We'll now run the python script by typing this: python3 ifsitegen.py -i parchment-for-inform7.zip -a /Applications/Inform-6M62.app six.gblorb (the -a argument and path that comes after is not needed if your Inform app is just called Inform and sits in your Applications folder, the default situation. Since I renamed mine to have a nonstandard name, Inform-6M62, I have to use the -a argument to point the python script to it) (the 'parchment-for-inform7.zip' bit makes sure this script uses the new parchment template instead of the old) The result should be a release folder containing the game and index file. Rename the Release folder 'six' (or whatever game it is). The index.html file in the game folder is going to be the base file we'll tweak to make it work with IF Recorder. HAVING SET THE BULK OF THIS STUFF UP OFFLINE, IT'S TIME TO PUT IT ONLINE. COPY YOUR WHOLE PARCHMENT DIRECTORY TO WHERE YOU WANT IT ON YOUR WEBSPACE! WHEN YOU EDIT FILES FROM NOW ON IN THIS PROCESS, EDIT THE ONLINE COPIES... OR EDIT THE OFFLINE ONES, THEN COPY THEM OVER THE ONLINE ONES WHENEVER YOU'RE SATISFIED WITH LOCALLY TESTED CHANGES. -------------------- Time to set up mysql database on your webspace that will hold the recorded transcripts. ****MYSQL SETUP Login to cpanel. Go to Databases -> mysql databases. Create a database called transcripts. Your ISP may automatically prefix your account name, in which case the resulting database's name will actually be yourusername_transcripts Add a new user. Call it root and create a password. Create the user. Add the root user to the database with ALL privileges. From IF Recorder docs: "The PHP scripts have the database configuration in the tools/include/db.php file. Add the SQL username/password and other information there." Edit the dp.php file to include your info. Specifically, the database name, user name and password. To set up the database structure, go to cpanel->Databases->phpMyAdmin Click Database tab. Click your database. Click query tab. Make your query be the bulk of text copied from this file: https://github.com/juhana/if-recorder/blob/master/doc/database.sql (link comes from IF Recorder instructions page.) The line " `info` text DEFAULT ''," can be deleted. When I tried it, it was announced as being deprecated. The rest seems to work. Once all the query text has been pasted, click SUBMIT QUERY. Bam! Your database should now have those two tables in it, and be ready. ****EDITING THE INDEX.HTML FILE TO HAVE IT INVOKE THE RECORDER Now we edit the index.html file to include a thing that will activate the recorder. First I'll quote Dannii's post: "You will need to set the story name in the URL like this: recording_url: 'tools/server/save-sql.php?story=six', (Though IÕve just realised I could probably have used the recording_label option instead. Oh well.) The built in viewer appears to work, at least when IÕve been testing it. I didnÕt have to change any of its code. I had to hack out a lot of it - for example it will say that every transcript has 0 turns. More work could be done to fix that IÕm sure, but IÕm probably not the right person for it. My PHP is very rusty now. It might actually be better to start from scratch for the server software. My take away from this is that I donÕt think that the GlkOte recording functionality was ever intended to work with JuhanaÕs original IF Recorder server, itÕs just too different. I donÕt know how the IFComp site handles both protocols then." So that 'recording_url: 'tools/server/save-sql.php?story=six', line should be added to the index.html file in the parchment options section. Also add 'recording_format: 'simple',' in the same place. With these in place, visiting the game's index.html online will automatically record a transcript of the session, identified by the story name set in the recording_url (e.g. six) Look in the database via your cpanel and you'll see one 'stories' entry per transcript, and multiple related 'transcripts' entries per transcript. ****HOW TO VIEW TRANSCRIPTS ONLINE You can see how may there are, for which games, and click one at a time to view contents. Visit the viewer index.php file as an URL. e.g. In your setup on your website, visit (whatever prefix)...parchment/tools/viewer/index.php in a browser. ****HOW TO MASS EXPORT TRANSCRIPTS TO TEXT FILES You have to be able to run the export.php script in place on your webspace. Just running it on your local copy from Terminal will NOT work, because the database files aren't on your computer, they're out on your webspace! Running the export.php script in place on your webspace requires an SSH connection to your webspace. I had to ask my ISP to enable SSH for my account type. Whether you've got SSH capability already or not, you'll need it to do the following. In Terminal, you type ssh (yourusername)@(yourdomain) You'll have to look up what yourdomain will be for your ISP. You're then asked for your ftp password. At the new prompt, you're in your webspace. Navigate to the viewer directory. e.g.: cd public_html/parchment/tools/viewer In this directory, run the script with php export.php just to see the options. You can then export all transcripts to a folder (in this location) called 'transcripts' by typing the following: php export.php --all --path transcripts The folder will be created if it doesn't exist.