- 1,325

- In the gravel trap
- 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:
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.
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.
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 ‘Info updated at <time> <date>’ 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’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.
(For the above command to work, ImageMagick must be installed in C:\ImageMagick)
One final tip is that because I didn’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.
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:
- A DropBox account: It may be best to setup a new one for your racing series.
- A GMail account: Only used in order to gain access to Google Docs.
- A program called ‘SiteShoter’, a freeware program available here.
- Access to a Windows PC which has the DropBox software installed on it.
- Optionally, the ImageMagick software package, available for free here.
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.
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
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 ‘Info updated at <time> <date>’ 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’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
One final tip is that because I didn’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: