purple-hats icon indicating copy to clipboard operation
purple-hats copied to clipboard

It should be possible to script the execution

Open mgifford opened this issue 9 months ago • 2 comments

I'd love to be able to run this on a bunch of sites from the command line. Even just being able to execute it on cron, so that every Sunday night so we have a fresh report to look at every week. 

The current approach doesn't allow for an execution like this. The Desktop and CLI Interface are nice if you want to scan a web site every once in a while, but after a few weeks you really don't want to go through the steps of doing this by hand.

mgifford avatar Oct 26 '23 16:10 mgifford

you already can. for example

node cli.js -c 2 -o siturl1-a11y-scan-results.zip -u https://site1.com -d 'iPad (gen 7) landscape' -k "yourname:[email protected]"

Were you looking for something different

brianteeman avatar Mar 14 '24 15:03 brianteeman

I see in your closed #9 you wanted something even simpler. You could use a bash script for that


#!/bin/bash

# Define the default parameters
Device='iPad (gen 7) landscape'
Key='yourname:[email protected]'

# Function to perform the scan
scan() {
    node cli.js -c 2 -o "$1-a11y-scan-results.zip" -u "https://$1" -d "$Device" -k "$Key"
}

# Check for argument
if [ -z "$1" ]; then
    echo "Usage: $0 <site>"
    exit 1
fi

# Call the scan function with the provided argument
scan "$1"

Now, you can simply run ./scan.sh site1.com to perform the scan on site1.com with default parameters. Adjust the script according to your needs if you want to change default parameters or add more options.

brianteeman avatar Mar 14 '24 15:03 brianteeman