Skip to content

Instantly share code, notes, and snippets.

@tzkmx
Created February 27, 2017 20:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tzkmx/8dba379773d8362a0888a799057b7f49 to your computer and use it in GitHub Desktop.
Save tzkmx/8dba379773d8362a0888a799057b7f49 to your computer and use it in GitHub Desktop.
Windows batch file to validate list of URLs with AMP errors
@ECHO OFF
FOR /F "usebackq tokens=1 delims=," %%A IN (`grep -v "URL" elsemanario-com__etiqueta_HTML_prohibida.csv`) DO (
FOR /F "usebackq" %%B IN (`amphtml-validator --format=json %%A`) DO (
echo %%B|findstr /C:"PASS" >NUL 2>&1
IF not errorlevel 1 (
echo %%A | tee -a valid_urls.txt
) ELSE (
echo %%A | tee -a nonvalid_urls.txt
)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment