3 $viewer_path = &ParseArgs
();
5 if (defined($OSNAME)) {
14 if ($ostype eq "win32") {
16 $viewer = $viewer_path . "\viewer.exe";
17 print $viewer_path . "\\viewer.exe" . "\n";
18 if (-e
$viewer_path . "\\viewer.exe") {
19 system ($viewer_path . '\\viewer.exe -v -d 15 -f url.txt > result.txt');
22 die $viewer_path . "viewer doesn't exist! Check your path.\n";
26 #=================================================================
30 if ($ostype eq "unix") {
32 $viewer = $viewer_path . "/viewer";
33 if (-e
$viewer_path . "/viewer") {
34 $ENV{'MOZILLA_HOME'}=$viewer_path;
35 $ENV{'LD_LIBRARY_PATH'}=$viewer_path;
36 system ($viewer_path . '/viewer -v -d 9 -f ./url.txt > result.txt');
39 die $viewer_path . "/viewer doesn't exist! Check your path.\n";
42 #=================================================================
44 open (ANALYSIS_FILE
, '>analysis.html') || die ("can't open file jim");
45 ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst)=localtime(time);
60 print "Content-type:text/html\n\n";
61 print (ANALYSIS_FILE
"<HTML><HEAD><TITLE> Load URl's Analysis File </TITLE></HEAD>\n");
62 print (ANALYSIS_FILE
"<BODY>\n");
63 print (ANALYSIS_FILE
"<H2><CENTER> Load URL's Analysis File </CENTER></H2>\n");
64 print (ANALYSIS_FILE
"<BR>\n");
65 print (ANALYSIS_FILE
"<BR>\n");
66 print (ANALYSIS_FILE
"<HR>\n");
67 print (ANALYSIS_FILE
"<BR>\n");
68 print (ANALYSIS_FILE
"<B><CENTER>\n");
69 print (ANALYSIS_FILE
"Day Date Year and Time when Program started: ");
70 print (ANALYSIS_FILE
"</B></CENTER>\n");
71 print (ANALYSIS_FILE
"<BR>\n");
72 print (ANALYSIS_FILE
"<B><CENTER>\n");
73 print (ANALYSIS_FILE
"$weekday{$wday} $mon/$mday/19$year $hour:$min:$sec");
74 print (ANALYSIS_FILE
"</B></CENTER>\n");
75 print (ANALYSIS_FILE
"<BR>\n");
76 print (ANALYSIS_FILE
"<BR>\n");
77 print (ANALYSIS_FILE
"<HR>\n");
79 open (IN_FILE
, '<result.txt');
80 open (OUT_FILE
, '>loaded.txt');
81 open (URL_FILE
, '<Url.txt');
82 open (NOMATCH_FILE
, '>notloaded.txt');
85 @Url_List = (0..24,0..1);
91 #push (@Url_List, "$ThisLine 0");
92 @Url_List[$count]->[0] = $ThisLine;
93 @Url_List[$count]->[1] = 0;
94 #print "@Url_List[$count]->[0] ";
95 #print "@Url_List[$count]->[1] \n";
103 print (OUT_FILE
"$ThisLine");
108 open (OUT_FILE
, '<loaded.txt');
111 $NumItems = @Url_List;
117 for ($i = 0; $i < $NumItems-1; $i += 1)
119 $InList = @Url_List[$i]->[0];
120 if ($ThisLine =~ /$InList/)
122 #print @Url_List[$i]->[0];
124 @Url_List[$i]->[1] = 1;
128 for ($i = 0; $i < $NumItems-1; $i += 1)
130 if (@Url_List[$i]->[1] == 0)
132 print (NOMATCH_FILE
"@Url_List[$i]->[0]\n");
136 close (NOMATCH_FILE
);
138 open (OUT_FILE
, '<loaded.txt');
139 open (NOMATCH_FILE
, '<notloaded.txt');
149 while (<NOMATCH_FILE
>)
155 close (NOMATCH_FILE
);
157 ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst)=localtime(time);
173 print (ANALYSIS_FILE
"<BR>\n");
174 print (ANALYSIS_FILE
"<B><CENTER>\n");
175 print (ANALYSIS_FILE
"Day Date Year and Time when Program stopped: ");
176 print (ANALYSIS_FILE
"</B></CENTER>\n");
177 print (ANALYSIS_FILE
"<BR>\n");
178 print (ANALYSIS_FILE
"<B><CENTER>\n");
179 print (ANALYSIS_FILE
"$weekday{$wday} $mon/$mday/19$year $hour:$min:$sec");
180 print (ANALYSIS_FILE
"</B></CENTER>\n");
181 print (ANALYSIS_FILE
"<BR>\n");
182 print (ANALYSIS_FILE
"<BR>\n");
183 print (ANALYSIS_FILE
"<HR>\n");
184 print (ANALYSIS_FILE
"<BR>\n");
185 print (ANALYSIS_FILE
"<B>\n");
186 print (ANALYSIS_FILE
"Number of URL's NOT loaded = ");
187 print (ANALYSIS_FILE
"$NotLoadItems\n");
188 print (ANALYSIS_FILE
"</B>\n");
189 print (ANALYSIS_FILE
"<BR>\n");
190 print (ANALYSIS_FILE
"<BR>\n");
192 open (OUT_FILE
, '<loaded.txt');
193 open (NOMATCH_FILE
, '<notloaded.txt');
195 while (<NOMATCH_FILE
>)
198 print (ANALYSIS_FILE
"<A HREF='$ThisLine'>$ThisLine</A>\n");
199 print (ANALYSIS_FILE
"<BR>\n");
202 print (ANALYSIS_FILE
"<BR>\n");
203 print (ANALYSIS_FILE
"<B>\n");
204 print (ANALYSIS_FILE
"Number of URL's loaded = ");
205 print (ANALYSIS_FILE
"$LoadItems\n");
206 print (ANALYSIS_FILE
"</B>\n");
207 print (ANALYSIS_FILE
"<BR>\n");
208 print (ANALYSIS_FILE
"<BR>\n");
213 print (ANALYSIS_FILE
"$ThisLine\n");
214 print (ANALYSIS_FILE
"<BR>\n");
217 print (ANALYSIS_FILE
"</BODY>\n");
218 print (ANALYSIS_FILE
"</HTML>\n");
223 close (NOMATCH_FILE
);
224 close (ANALYSIS_FILE
);
229 if( (@ARGV == 0) || (@ARGV > 1) ) {
233 $viewer_path = $ARGV[0];
239 die "usage: LoadUrl.pl <directory containing viewer app>";