@echo off
echo b.btm -- process brokenlinks
pushd
cdd E:\com\mindprod\brokenlinks
if "%runwith" == "" set runwith=jet
if "%runwith" == "jet" goto usingjet
:notusingjet
set brokenlinks=java.exe -ea -jar E:\com\mindprod\brokenlinks\brokenlinks.jar
set csvalign=java.exe -ea -jar E:\com\mindprod\csv\csvalign.jar
set csvpatch=java.exe -ea -jar E:\com\mindprod\csv\csvpatch.jar
set csvsort=java.exe -ea -jar E:\com\mindprod\csv\csvsort.jar
set extracti=java.exe -ea -jar E:\com\mindprod\extract\extracti.jar
set csvreplaceurls=java.exe -ea -jar E:\com\mindprod\csv\csvreplaceurls.jar
set withouti=java.exe -ea -jar E:\com\mindprod\extract\withouti.jar
goto setsready
:usingjet
set brokenlinks=java.exe com.mindprod.brokenlinks
set csvalign=csvalign.exe
set csvpatch=csvpatch.exe
set csvsort=csvsort.exe
set extracti=extracti.exe
set csvreplaceurls=csvreplaceurls.exe
set withouti=withouti.exe
:setsready
%brokenlinks% mindprod.properties
cdd E:\mindprod\jgloss
call one brokenlinks.html
cdd E:\env\bl
set avoid=anrdoezrs barnesandnoble clickbank condomblogs esellerate linksynergy linksynergy nytimes phone qksrv sextoy Victoria webring
%withouti% %avoid - permanentRedirects.csv > safepermanent.csv
%csvsort% safepermanent.csv 2s+ 1s+
%csvalign% safepermanent.csv
vs safepermanent.csv
echo.
echo apply safe permanent redirects?
confirm.exe
if ERRORLEVEL 1 goto bypass1
%csvreplaceurls% safepermanent.csv
echo patching hassle.csv
%csvpatch% E:\com\mindprod\submitter\hassle.csv safepermanent.csv 1 2
echo patching nohassle.csv
%csvpatch% E:\com\mindprod\submitter\nohassle.csv safepermanent.csv 1 2
echo patching candidates.csv
%csvpatch% E:\com\mindprod\submitter\candidates.csv safepermanent.csv 1 2
echo patching phone.csv
%csvpatch% E:\com\mindprod\phone\phone.csv safepermanent.csv 1
echo patching air.csv
%csvpatch% E:\com\mindprod\repair\air.csv safepermanent.csv 4
pause
:bypass1
set suspend=error suspend 404 shawcaassist
%extracti% %suspend% - permanentRedirects.csv > suspended.csv
%extracti% %suspend% - temporaryRedirects.csv >> suspended.csv
%csvsort% suspended.csv 2s+ 1s+
%csvalign% suspended.csv
vs E:\com\mindprod\submitter\dead.csv suspended.csv
Echo. You will need to apply the suspended.csv changes manually as if they were 404 broken links.
echo.
pause
%withouti% %avoid - temporaryRedirects.csv > safetemporary.csv
%csvsort% safetemporary.csv 2s+ 1s+
%csvalign% safetemporary.csv
vs safetemporary.csv
echo.
echo apply safe temporary redirects?
confirm.exe
if ERRORLEVEL 1 goto bypass2
echo it is unusual to apply temporaries. Are you sure?
confirm.exe
if ERRORLEVEL 1 goto bypass2
%csvreplaceurls% safetemporary.csv
echo patching hassle.csv
%csvpatch% E:\com\mindprod\submitter\hassle.csv safetemporary.csv 1 2
echo patching nohassle.csv
%csvpatch% E:\com\mindprod\submitter\nohassle.csv safetemporary.csv 1 2
echo patching candidates.csv
%csvpatch% E:\com\mindprod\submitter\candidates.csv safetemporary.csv 1 2
echo patching phone.csv
%csvpatch% E:\com\mindprod\phone\phone.csv safetemporary.csv 1
echo patching air.csv
%csvpatch% E:\com\mindprod\repair\air.csv safetemporary.csv 4
pause
:bypass2
%extracti% phone - permanentRedirects.csv > phoneredirects.csv
%csvsort% phoneredirects.csv 2s+ 1s+
%csvalign% phoneredirects.csv
vs phoneredirects.csv
echo.
echo apply phone redirects?
confirm.exe
if ERRORLEVEL 1 goto bypass3
echo it is unusual to apply phone redirects. Are you sure?
confirm.exe
if ERRORLEVEL 1 goto bypass3
echo patching phone.csv
%csvpatch% E:\com\mindprod\phone\phone.csv phoneredirects.csv 1
:bypass3
echo tidying hassle.csv
call E:\com\mindprod\submitter\tidy.btm
echo tidy htmlmacros csv files
call E:\com\mindprod\htmlmacros\tidy.btm
echo tidying air.csv
call E:\com\mindprod\repair\tidyair.btm
echo tidying phone.csv
call E:\com\mindprod\phone\prepare.btm
echo fixing css classes
call E:\com\mindprod\repair\assigncssclasseses.btm
echo fixing htmlmacros cvs
call E:\com\mindprod\htmlmacros\tidy.btm
cdd E:\env\bl
del xenupage.csv
popd
echo d o n e