20131110
étape de:
AntiguideMoralisation, intégrée dans
PagespersoFreeBrebis
refait: maintenant seulement 185 Mo ajoutés. c'est cohérent
voir aussi:
PagesPersoFreeRechercherOrphelins appliqué il y a quinze jours, trop limité
une solution par reponses "erreur 404" dans un wgeyt
ici l'outil pour recopier les fichier égarés depuis sauvegarde
cherche dans une capture par wget les fichiers qui ne sont pas dans la copie par ftp
et les recopie du dossier juillet 2013 dans le dossier plus
faudra faire de même pour flavigny (présent dans 147 pages) mais là, nécessite changement dans la page!
' chgt.vbs
np="!panacee"
'si source wikini
' http://antiguide.free.fr/wiki/wakka.php?wiki=
' si source web
' http://antiguide.free.fr/wiki/wakka.php@wiki=
' --------- prototype à chercher dans les pages traitées
lonhtml= 1 ' 6 si .html
dim proto(10)
dim relatif(10)
nbproto=1
' exemple si source wikini
proto(0)="""http://antiguide.free.fr"
sauf="http://antiguide.free.fr/wiki/wakka.php?wiki="
Set WshShell = WScript.CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
chateau=false
set oArgs=WScript.Arguments ' tableau d'arguments
if oArgs.Count<>1 then
msgbox "loc antiguide"
wscript.quit
end if
ndo=0
' explorer les noms présents
fichier=oArgs(0)
if not fso.fileexists (fichier) then
msgbox "pas fichier"
wscript.quit
end if
set fi=fso.opentextfile(fichier)
set fo=fso.createtextfile(fichier & ".log")
'msgbox "go"
while not fi.atendofstream
une=fi.readline
unesave=une
'msgbox "lu " & vcrlf & une
for ip=0 to nbproto-1
dep=1
' msgbox "chercher " & proto(ip) & vbcrlf & "dans" & vbcrlf & mid(une,dep)
while instr(dep,une,proto(ip))
x=instr(dep,une,proto(ip))
if x>0 then
dep=x+1
fin =instr(dep+1,une,"""")
' msgbox "trouve a " & x & " fin=" & fin
if fin=0 then
msgbox "fin zero" & vbcrlf & une
wscript.quit
end if
cible=mid(une,dep,fin-dep+1)
' msgbox unesave & vbcrlf & proto(ip) & vbcrlf & "examine" & vbcrlf & cible
if instr(cible,sauf)=0 then
'msgbox "dans " & vbcrlf & unesave & vbcrlf & "ouf conserver " & vbcrlf & cible
c1= cible
cible=mid(cible,len("http://antiguide.free.fr/")+1)
c2=""
for ic=1 to len(cible)
car=mid(cible,ic,1)
if car="/" then car="\"
c2=c2 & car
next
if len(c2)>0 then
if mid(c2,len(c2),1)="""" then c2=mid(c2,1,len(c2)-1)
end if
cible=c2
chateau= instr(cible,"Chateauneuf")>0
if chateau then msgbox "on regarde " & vbcrlf & cible
ftp="C:\Users\adminpo\Desktop\antiguide\20131109-2200_antiguide_par_ftpbinary\antiguide.free.fr\" & cible
' GAFFE ci dssous semble répondre même si est déjà la!
if not fso.fileexists(ftp) then
if chateau then
msgbox "pas deja dans ftp chateau " & vbcrlf & ftp
fo.writeline ftp
wscript.quit
end if
a="C:\Users\adminpo\Desktop\antiguide\20130307_antiguide.free.fr\20130308_ftp\_\" & c2
' racine="C:\Users\adminpo\Desktop\antiguide\20131109-2200_par_ftpbinary" & "\plus\"
racine="C:\Users\adminpo\Desktop\antiguide\20131110-0700_antiguide_recherche_liens_morts" & "\plus\"
c=racine
b=c &c2
if not fso.fileexists (a) then
' msgbox "pas source a a " & a
else
chem=mid(b,1,instrrev(b,"\"))
' msgbox "examiner cjhemin " & vbcrlf & b & vbcrlf & chem
if not fso.folderexists (chem) then
' msgbox "pas chemin plus " & chem
isl=len(racine)
while instr(isl,chem,"\")>0
xxx=instr(isl,chem,"\")
' fo.writeline "rem mkdir " & mid(chem,1,xxx)
if not fso.folderexists (mid(chem,1,xxx)) then
fo.writeline "mkdir " & mid(chem,1,xxx)
' msgbox "create folder " & vbcrlf & (mid(chem,1,xxx))
fso.createfolder (mid(chem,1,xxx))
end if
isl=xxx+1
wend
else
' msgbox "copier" & vbcrlf & a & vbcrlf & b
'
if fso.fileexists (b) then
' msgbox "deja " & b
else
fo.writeline "copy """ & a & """ """ & b & """"
' fo.writeline b
if fso.fileexists (b) then msgbox "bug ecrase " & vbcrlf & b
fso.copyfile a,b
end if 'b
end if 'c
end if ' a
end if 'ftp
end if 'sauf
end if 'x >0
wend
next 'ip
wend
fi.close
fo.close
msgbox "fou!"