Publishing Racing Series Results Spreadsheets Automatically

  • Thread starter Thread starter RDAardvark
  • 11 comments
  • 5,978 views
Status
Not open for further replies.

RDAardvark

Missing every apex
Premium
Messages
1,325
Ireland
In the gravel trap
Messages
RDAardvark
Background

As any Race Director knows, getting race results and a league table updated and published is time consuming and can be troublesome. Keeping your registration list up to date is even more time consuming. When ORCA ran the Alfa Zagato TZ2 series, I inherited a clever spreadsheet for recording results, but publishing them involved taking screenshots, cropping these images, uploading them and then asking the Race Director to update the posts with the new images.

The use of Photobucket, ImageShack and the like generate a seemingly random link every time you upload a new image, meaning you then have to update your post to link to the new image. I found this very time consuming and only possible if you made the post in the first place. So, I set myself a challenge of automating this as much as possible. The system I came up with is detailed below: I’m not saying it’s perfect but it certainly works and requires the minimum of interaction once it is setup. One huge advantage is that anyone can update the results and doesn't rely on the Racing Director's to update the post. We were also able to automate the registration process using a Google Doc form which produced a drivers list spreadsheet.

The system works by using DropBox as the store for all your images. DropBox has a Public folder and it is in here you store your images. You can then update these image files without having to revise your post on GTPlanet. In order to update the images automatically, you will run a program which will grab an image of your spreadsheet or document from Google Documents. This is then saved as a file on your PC in the Public DropBox folder. DropBox then automatically updates the image on the web, and the updated image will then be visible in your post.


Requirements

Before you begin, you will need:

  1. A DropBox account: It may be best to setup a new one for your racing series.
  2. A GMail account: Only used in order to gain access to Google Docs.
  3. A program called ‘SiteShoter’, a freeware program available here.
  4. Access to a Windows PC which has the DropBox software installed on it.
  5. Optionally, the ImageMagick software package, available for free here.
Some knowledge of Windows Scripting will help but isn’t essential.


Getting Started

Starting at the PC, ensure that the DropBox software is installed and a dropbox is configured on the computer. For the sake of simplicity, I suggest you create your dropbox at the root of the C: drive.

Next, create a folder in your dropbox and give it a name related to your racing series. This folder will be used to hold all the configuration files, programs, etc that you need to implement the automatic publishing system. By storing all this in your dropbox, you automatically get a backup of your system and can easily move it to another computer. In this document, I refer to this folder as your 'non-public' folder.

Next, download the ‘SiteShoter’ program and extract it to your ‘series’ folder in the dropbox.

So now you have everything in place, you now need to visit Google Docs and prepare your document(s) for publishing.


Google Docs

Once you have created the documents or spreadsheets that you want to publish, you will need to change the security on them. This is so that the SiteShoter program can access them without having to sign into Google Docs (something which would be impossible).

So, change the Sharing status of your document(s) to ‘Anyone with the link can view’. At this stage is is also worth copying the link for each document you want to publish as you will need this information in the next stage. I suggest opening Notepad on your computer and pasting the link in there. If you are publishing more than one document, add a description to each link.

One thing to note here is that you may find it useful to create an area of blank space around the information you want to publish. This makes it easier to avoid having column and row headers in the captured image. I simply insert empty rows and columns and then colour the background to be the same as GTPlanet’s default background colour.


SiteShoter Configuration

While hunting around the interwebs, I found plenty of tools that could make an image file of a webpage, but SiteShoter was the only tool I found that allows you to specify the area of the web page you want to capture. Plus when you run the app and enter all the settings, you can then save that configuration in a file. Thus you can build up a library of configuration files, one for each image you need to make.

If you open the SiteShoter program, you’ll see something similar to the image below. To start, enter the URL of one of your Google Docs into the ‘Single URL/File’ field. Next, enter a filename for the captured image. Note that this will be a .png file and you should save this in the Public folder of your DropBox.
SiteShoter.jpg

You will now need to change some of the other settings in order to let the program do its job. Start by copying the ‘Web Browser Settings’ from the image into the program on your PC. You’ll need to tweak the Left, Top, Width and Height figures, but for now use my settings.

You’ll notice that I’ve set the ‘Timeout’ value to 25000 (25 seconds). This gives Google Docs 25 seconds to load, recalculate and display my spreadsheet before a snapshot is taken. For very complex documents, you may find you need to increase this value.

Finally, tick the box that says ‘Open the screenshot file after save’ and the press the ‘Start’ button. SiteShoter will now do its stuff and create the image file. Once it has created it, it should open it for you to view. You can now start changing the Left, Top, Width and Height options so that it only captures what you need it to capture. Patience is required here as you simply adjust, press Start, review the results and repeat if necessary.

Once you are happy with the resultant image, untick the ‘Open the screenshot file after save’. The press the ‘Save Config’ option and save the configuration file to the same folder that SiteShoter resides in (your non-public DropBox folder).

Repeat this for any other documents that you want to publish, saving each configuration in a unique file.

Note: If you are publishing spreadsheets and need to publish information on different sheets, then simply add '#gid=2' to the end of the Google Docs url. In this example, the 2 refers to the third sheet in your spreadsheet. The first one is called 0, the second is 1 and so on.


Back To DropBox

Now that you’ve created your image file, simply by creating it in the Public folder in your DropBox means that it gets uploaded to the web and is ready for linking.

In order to find out the URL of the image file, you’ll need to login to the DropBox website. Then simply navigate to the Public folder, right click on the file and select the ‘Copy Public link’ option. You can now use this URL in your GTPlanet post. Every time the image is updated in your DropBox, the updated image will be seen on GTPlanet.

Side note: Have a look at the URL. If you are linking multiple files, the URL for each file will be the same except for the filename at the end. This info can be very useful as you can simply paste the first part of the URL into your GTPlanet post and then simply append each image filename. This is also useful if you want to publish a photo of race results: You can take a photo on your smartphone and upload it to DropBox if you have the app installed on your phone.


Automating Image Creation

The final piece of the jigsaw is to automate the creation of the image files using SiteShoter. This needs a little bit of scripting but nothing too taxing. The following is a script I used to update the tables for the ORCA event. This is saved in the non-public folder within your DropBox.

Code:
.\siteshoter /RunConfig .\alfaLeague.cfg
.\siteshoter /RunConfig .\Round1.cfg
I simply created a new text document, edited it so that it contained the text above and then saved the file as ‘League.cmd’ in the non-public DropBox folder. Simply replace ‘.\alfaleague.cfg’ with the name of your configuration file. Using the ‘.\’ before the filename simply means ‘in the current directory’. If you have multiple documents to publish, simply repeat the line, adjusting as necessary.

Finally, create a scheduled task in Windows that would run this script on a regular basis. A good tutorial on how to do this can be found here.


Other Tricks and Tips

When you are setting up SiteShoter, there is one setting that can come in very handy: Image size. This is expressed as a percentage. So if the width of your captured image was 1000 pixels, you'd ideally set the image size to 70%, giving an image width of 700 pixels. Using an image of this width avoids GTPlanet showing the 'Click to enlarge' info bar on the top of images it deems are too wide.

I recommend you put &#8216;Info updated at <time> <date>&#8217; into your spreadsheet somewhere. You can then tell at a glance whether you are looking at the most recent image in your post. Sometimes your browser is too clever and doesn&#8217;t refresh the image, so this is a good indicator.

You may also find it useful to use ImageMagick. This software is a very powerful image editor but it has the excellent feature of being able to trim blank space from around an image. It can also be called from a script. I run this software to trim all the images in my public folder by simply putting the line below in my script. You can add this to as the last command in your script you created in the last section.

Code:
for /F %%F in ('dir ..\Public\*.png /b') do  c:\ImageMagick\convert -trim .\%%F .\%%F
(For the above command to work, ImageMagick must be installed in C:\ImageMagick)

One final tip is that because I didn&#8217;t know how tall some tables would get, I set the capture height in SiteShoter to be way more than was required, but made sure that this space was always blank. So the captured image could contain this huge area of blank space. I then used the ImageMagick tip above in order to trim this space, leaving me with a closely cropped final image.



A Google Docs version of this information is available here.


Note to Mods: I can't identify a more suitable place for this information to go. Please move this thread if there is a more suitable place and accept my apologies.
 
Last edited:
This is amazing work, do you have a demo yet?
 
This is amazing work, do you have a demo yet?

If you follow the link to the ORCA thread, the registration table, league table and individual results are all updated using this method. The WRS also use this system in their registration process.

Demo image is below. If you enter data using this Google Docs form, the image will be updated to show this. The update takes place every 15 minutes.

Demo.png
 
Last edited:
Ah right I could see this being quite useful to a lot of people. Thanks for making the information public Aarkvark.

Looking forward to the demo and such. I don't know if I could use it for any of our series since people mostly refer to the sheets published through Gdocs itself.

When I first caught a glance at this thread I thought you were getting at a system that recognizes text in images and pulls that data :D

This technology does exist (Adobe Acrobat Reader for example) so it would be sweet if one day we could use something similar for even more automation.

Cheers
 
When I first caught a glance at this thread I thought you were getting at a system that recognizes text in images and pulls that data :D

That's what I thought too.
 
Ah right I could see this being quite useful to a lot of people. Thanks for making the information public Aarkvark.

Looking forward to the demo and such. I don't know if I could use it for any of our series since people mostly refer to the sheets published through Gdocs itself.

When I first caught a glance at this thread I thought you were getting at a system that recognizes text in images and pulls that data :D

This technology does exist (Adobe Acrobat Reader for example) so it would be sweet if one day we could use something similar for even more automation.

Cheers

That's what I thought too.

Hope this info is useful to someone!

The demo is up: It's quite limited but it should show the system working.

Sorry for any confusion: I've put the word 'Spreadsheet' into the thread title. Is there anything else I can put in to avoid the same confusion?

OCR was something I looked at: It would be fantastic if it would work but I've not found anything reliable yet. Plus, one problem is drivers with long driver names: These get truncated on the race results and would totally confuse an automated system.
 
I've added a sticky to this and moved it to the main Race Series forum, where it will likely be of the most use to people. I also left a permanent redirect in the interest check area, and will sticky that as well.

Great work you've done, making the community aware of this useful tool. 👍
 
This looks awesome man, gonna try this for my IndyCar series. Great work 👍
 
Note that the WRS has been using this process/method to handle automatic registration for our online events since I saw the work RDA had done with the ORCA thread and RDA explained it to me.

Today for example, we have four online races and without this process it would be very time consuming to keep track of who is racing and who's on reserve. See our implementation of the process here:

GTP WRS-Online : Special Event II - Saturday Marathon - Feb 25

A very big time saver for us because we run a non points series and have a different set of drivers every week to register for the event.

Also note that on the google side you can use some techniques to limit who can register so that you don't get randoms messing around with the forms. In fact they do occasionally mess around, but they just never make it into the image. Basically you have the form entries go into one worksheet and then "process" that worksheet using a VLOOKUP to a list of "registered" drivers. Then use a QUERY to select only those that match for the area you will use to create your image. Results can be extremely clean and completely automated.

Thanks RDA. 👍
 
Like many I personally use a google doc to manage our race results. Its still a chore but you simply just add a race result and the points are automatically added/updated.

Last season stats (click below tabs)

Here is a blank template if anybody would like to use it. I need to understand how to get the championship standings to automatically update the season and overall stats but have not figured it yet.

I need to read the first OP properly as I just had a quick scan to see how I can make it work.

Thanks
 
Hi there. I'd like to know if it's possible to do this process with a Mac.
 
Hi there. I'd like to know if it's possible to do this process with a Mac.

The only stumbling block would be finding a Mac equivalent of the SiteShoter program.

Googledocs should display fine. You'd also need to know AppleScript in order to put it all together. At least ImageMagick is available for Mac!
 
Status
Not open for further replies.
Back