Hébergement
Forum
#!/bin/awk -f
BEGIN {
RS="<"
}
# <IMG SRC ...
/^(I|i)(m|M)(g|G) .*(s|S)(r|R)(C|c)/ {
sub(/^(I|i)(m|M)(g|G) .*(s|S)(r|R)(C|c) *="?/,"",$0)
match($0,/[^" ]+("| )?/)
image = substr($0,RSTART,RLENGTH-1)
if ( image ~ /^http/ )
next
if ( length(image ) < 5 )
next
images[image]=1
next
}
# <SCRIPT SRC...
/^(s|S)(C|c)(r|R)(I|i)(P|p)(T|t) .*(s|S)(r|R)(C|c)/ {
sub(/^(s|S)(C|c)(r|R)(I|i)(P|p)(T|t) .*(s|S)(r|R)(C|c) *="?/,"",$0)
match($0,/[^" ]+("| )?/)
image = substr($0,RSTART,RLENGTH-1)
if ( image ~ /^http/ )
next
if ( length(image ) < 2 )
next
images[image]=1
next
}
#CSS
/^(L|l)(I|i)(N|n)(K|k) .*(H|h)(r|R)(E|e)(F|f)/ {
sub(/^(L|l)(I|i)(N|n)(K|k) .*(H|h)(r|R)(E|e)(F|f) *="?/,"",$0)
match($0,/[^" ]+("| )?/)
image = substr($0,RSTART,RLENGTH-1)
if ( image ~ /^http/ )
next
if ( length(image ) < 2 )
next
images[image]=1
next
}
END {
total=0
images[FILENAME]=1
for ( i in images )
{
command = "wc -c "i
command | getline
print i " " $1
total += $1
}
print "_______________"
print "total = "total
}