@echo off setlocal EnableExtensions EnableDelayedExpansion set "URL=%~1" if not defined URL set "URL=https://example.com/sitemap.xml" set "TMPFILE=%TEMP%\scriptdock-sitemap-%RANDOM%.xml" where curl.exe >nul 2>nul if errorlevel 1 ( echo curl.exe not found. exit /b 1 ) curl.exe -fsSL --max-time 30 -o "%TMPFILE%" "%URL%" if errorlevel 1 ( echo Download failed: %URL% if exist "%TMPFILE%" del "%TMPFILE%" exit /b 1 ) for %%A in ("%TMPFILE%") do echo Downloaded: %%~zA bytes set "COUNT=0" for /f %%C in ('type "%TMPFILE%" ^| findstr /c:"" ^| find /c /v ""') do set "COUNT=%%C" echo URL entries: !COUNT! echo First entries: set "SHOWN=0" for /f "usebackq delims=" %%L in (`findstr /c:"" "%TMPFILE%"`) do ( if !SHOWN! lss 10 ( echo %%L set /a SHOWN+=1 ) ) del "%TMPFILE%" >nul 2>nul endlocal