#!/usr/local/bin/perl
#
# imgextract.pl
#
# This program extracts image path/filename from your html source
# and prints it out the sorted and unique results
# As well supposed that your system has "uniq" and "sort" utilities.
# Now program supports following patterns:
# and
.
#
# Run "imgextract.pl" to see the run options
#
# Last modified: [22/4/96]
# Author: Bekman Stas
#
if ($#ARGV<0) {
die "
This program extracts image path/filename from your html source
and prints it out the sorted and unique results\n
Usage:
\t$0 filename(s) \n\n";
}
while(<>){
/IMG.*SRC\s*=\s*"\s*([^ ]*)\s*"/ig && (@images=(@images, $1)) ;
/BODY.*BACKGROUND\s*=\s*"\s*([^ ]*)\s*"/ig && (@images=(@images, $1)) ;
}
@list=join("\n",sort @images);
system "(echo \"@list\" |uniq -u; echo \"@list\" |uniq -d)|sort";