********************************************************************
REM This DOS-script will download the latest video's from Chris Pirillo
REM it uses grep (win32) sed (win32) diff (win32) wget (win32)
REM Made by: Patrick Becks
********************************************************************
d:
cd "d:\My Video\Omnia"
REM remove oldest video's (only 15 video's allowed!)
FOR /F "skip=15 delims=" %%a IN ('DIR /b /o-d /a-d') DO (
DEL %%a
)
cd d:\My Video\
del /q *.*
REM make a list to compare recent vid's with vid's on the internet
dir /b "d:\My Video\Omnia\" > Phone.txt
"d:\downloads\wget\wget"
http://feeds.pirillo.com/ChrisPirilloShow
c:
cd "c:\program files\gnuwin32\bin\"
REM manipulate the list so that it can be compared to Phone.txt
grep -o "http://.*mp4" "d:\My Video\ChrisPirilloShow" > "d:\My Video\down.txt"
sed -e "/lenght/d;/type/d;/fileSize/d" "d:\My video\down.txt" > "d:\My video\down2.txt"
sed -i "s/L0ckergn0me-/http:\/\/blip\.tv\/file\/get\/L0ckergn0me-/g" "d:\My Video\Phone.txt"
"C:\Program Files\tfd178\todos.exe" "d:\My video\Phone.txt"
"C:\Program Files\tfd178\todos.exe" "d:\My video\down2.txt"
sort < "d:\My video\Phone.txt" > "d:\My video\Phone2.txt"
sort < "d:\My video\down2.txt" > "d:\My video\down3.txt"
REM compare the 2 text-files!
diff -i -w "d:\My video\down3.txt" "d:\My video\Phone2.txt" > "d:\My video\Nieuw.txt"
sed -i "s/http/wget http/g" "d:\My Video\Nieuw.txt"
sed -i -nl -e "/</ {p;} " "d:\My Video\Nieuw.txt"
sed -i "s/<//g" "d:\My Video\Nieuw.txt"
sed -i "s/ wget/wget/g" "d:\My Video\Nieuw.txt"
"C:\Program Files\tfd178\todos.exe" "d:\My video\Nieuw.txt"
d:
cd d:\My Video\
path = %PATH%;d:\downloads\wget\
ren Nieuw.txt down.bat
cd Omnia
REM finally! DOWNLOAD the new Video's!
call ..\down.bat
del *.?
del /q ..\*.*
d:
cd "d:\My Video\Omnia"
FOR /F "skip=15 delims=" %%a IN ('DIR /b /o-d /a-d') DO (
DEL %%a
)
exit