NvvLazyTiger
Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору @echo off set sUrl=http://samlib.ru/ set wKey=-O- -q -U "Mozilla/5.0" set rChk=%~dp0siRepls1.awk set aFil=%~dp0siStat.awk for /F %%A in ('echo %~n1 ^| gAwk "{print tolower($0);exit;}"') do set inpt=%%A set aChr=%inpt:~0,1% set aNik=%inpt% if "%inpt:~1,1%" == "-" set aNik=%inpt:~2% if "%inpt:~1,1%" == "/" set aNik=%inpt:~2% set Boss=%aChr%/%aNik% echo ? req %Boss%/stat.shtml 2>%~dpn0.tmp set totA=0 set tBeg=9999.99.99 set tEnd=0000.00.00 for /F %%Q in ('wGet -O- -q %sUrl%/%Boss%/stat.shtml ^| gawk -f %aFil%') do call :getReplInfo %%Q rem call :getReplInfo rycarxbezstraha rem call :getReplInfo spisokfanfikowsmoimikommentarijami set /a totA+=100000000 echo totZ=%totA:~-6% begT=%tBeg% endT=%tEnd% boss=[%Boss%] >> %~dpn0.tmp echo totZ=%totA:~-6% begT=%tBeg% endT=%tEnd% boss=[%Boss%] >> %~dpn0.all sort /R %~dpn0.tmp >%aChr%-%aNik%.lst goto :eof :getReplInfo echo ? req repls info for %1 set urlP=%sUrl%comment/%Boss%/%1 for /F "tokens=1-6,*" %%A in ('wget %wKey% %urlP% ^| gawk -f %rChk%') do (set siTypP=%%A&set siRecN=%%B&set siPagN=%%C&set siArhN=%%D&set siEndD=%%F) if "%siTypP%" == "][" goto :eof if "%siRecN%" == "0" goto :eof if %siArhN% == 0 ( set pUrl="%urlP%?ORDER=reverse&PAGE=1" ) else ( set pUrl="%urlP%.1?ORDER=reverse&PAGE=1" ) rem echo ### 1 for /F "tokens=1-6,*" %%A in ('wget %wKey% %pUrl% ^| gawk -f %rChk%') do (set siBegD=%%E&set "siNamS=%%G") rem echo ### 2 set siBegD=%siBegD:~0,10% set siEndD=%siEndD:~0,10% set /a tmp0=(%siArhN%*1000)+%siRecN% set /a totA+=%tmp0% set /a tmp0+=100000000 echo totR=%tmp0:~-6% begR=%siBegD% endR=%siEndD% boss=[%Boss%] text=%1 "%siNamS%">> %~dpn0.tmp if %tBeg% GTR %siBegD% set tBeg=%siBegD% if %tEnd% LSS %siEndD% set tEnd=%siEndD% |