include("WBInclusions") if length(ARGS) < 1 println(" Need a string to search for") exit(16) end global str = Regex(replace(replace(ARGS[1], "%%1%" => "^"), "%%2%" => ">") , "i") global VERSION = "015" global BASE = "/ROM/BO/c9/" global DIRS = 0 global DISCARDS = 0 global PROCESSED = 0 global HITS = [] global SIZE = 0 global HREFS = 0 global SRCS = 0 function RD(dir) global DIRS += 1 # println(" dir: \"",dir, "\"") files = readdir(dir) for f in files if isdir(dir * f) RD(dir * f * "/") continue end if !endswith(f, ".html") global DISCARDS += 1 continue end ff = dir * f b = RRead(ff, "asis") c = findall(str, b) if length(c) > 0 fff = replace(ff[length(BASE) + 1 : length(ff)], "/" => "\\") push!(HITS, [ff, length(c)]) #println(" ", fff) end global HREFS += length(findall(" href=\"", b)) global SRCS += length(findall(" src=\"", b)) global PROCESSED += 1 global SIZE += length(b) end end println("") RD(BASE) println(" PROCESSED: ", PROCESSED, ". DIRS: ", DIRS, ". DISCARDS: " , DISCARDS, ". > JUNK6.html. (", formatFixed(SIZE) , " ", formatFixed(HREFS), " ", formatFixed(SRCS) * ")") a = open("JUNK6.html", "w") write(a, "\n\n\n\nFrustra\n\n\n\n
\n\n\n") global SHIT = Dict{String, Any}() for i = 1 : length(HITS) hit = HITS[i] h = hit[1] pfx = length(findall("/", h)) > 4 ? "0" : "1" SHIT[pfx * lowercase(h)] = hit end global kk = [] for k in keys(SHIT) push!(kk, string(k)) end kkk = sort(kk) global PREVX = "X" for kkkk in kkk shit = SHIT[kkkk] h = shit[1] hlen = shit[2] kkkk1 = kkkk[1:1] sz = kkkk1 != PREVX ? 12 : 0 write(a, "\n") global PREVX = kkkk1 end write(a,"
" * string(str) * "
" * h[12 : length(h)] * "" * string(hlen) * "
\n\n") close(a)