i have this piece of code which i want to chage a little
instead of having a cam on 'my $url' i want this to be Variable to which i make the variation when i call up the script
for e.g. http://reviews.numerique-photo.com/clipper.cgi?cam=<font color=red>221</font>
I hope you understand sorry hard to explain
#!/usr/local/bin/perl
use strict;
use CGI;
use LWP::Simple;
my $domain = $ENV{'QUERY_STRING'};
my $ssaveas = "f:/inter-markets/gallery/db/cgi-bin/pixer/top.txt";
my $url = "http://reviews.numerique-photo.com/cameraDetail.php3?cam=<font color=red>244</font>";
my $results = get ($url);
my $output = '';
my ($thisweek, $lastweek, $title, $topimg, $imgalt);
my $n = 0;
$results or &error ("No Updates Available");
$results =~ s/\r//g;
$results =~ s/\n//g;
# USE ([^<]*)
while ($results =~ m#<td width="300"><font size="-1" face="Verdana,Arial,Helvetica">([^<]*)</font></td>#sog) {
$n = $n + 1;
print "GOT OUTPUT!";
if ($n <= 24) {
($thisweek, $lastweek, $title) = ($1, $2, $3);
if ($lastweek eq "*") {
$topimg = "";
$imgalt = "";
}
else {
$topimg = "";
$imgalt = "";
}
$output .= qq~|$thisweek~;
}
}
open (ID, ">$ssaveas") or print ("error. unable to open file.
");
print ID $output; # update counter.
print ID $output; # update counter.
print ID "";
close ID;
print "Content-type: text/plain\n\n";
print "Top Games Update Complete";
exit();
instead of having a cam on 'my $url' i want this to be Variable to which i make the variation when i call up the script
for e.g. http://reviews.numerique-photo.com/clipper.cgi?cam=<font color=red>221</font>
I hope you understand sorry hard to explain
#!/usr/local/bin/perl
use strict;
use CGI;
use LWP::Simple;
my $domain = $ENV{'QUERY_STRING'};
my $ssaveas = "f:/inter-markets/gallery/db/cgi-bin/pixer/top.txt";
my $url = "http://reviews.numerique-photo.com/cameraDetail.php3?cam=<font color=red>244</font>";
my $results = get ($url);
my $output = '';
my ($thisweek, $lastweek, $title, $topimg, $imgalt);
my $n = 0;
$results or &error ("No Updates Available");
$results =~ s/\r//g;
$results =~ s/\n//g;
# USE ([^<]*)
while ($results =~ m#<td width="300"><font size="-1" face="Verdana,Arial,Helvetica">([^<]*)</font></td>#sog) {
$n = $n + 1;
print "GOT OUTPUT!";
if ($n <= 24) {
($thisweek, $lastweek, $title) = ($1, $2, $3);
if ($lastweek eq "*") {
$topimg = "";
$imgalt = "";
}
else {
$topimg = "";
$imgalt = "";
}
$output .= qq~|$thisweek~;
}
}
open (ID, ">$ssaveas") or print ("error. unable to open file.
");
print ID $output; # update counter.
print ID $output; # update counter.
print ID "";
close ID;
print "Content-type: text/plain\n\n";
print "Top Games Update Complete";
exit();