This is it! And I need some additional information about how can I use condition IF under perl language, because I need to use the second URL only for one country Canada (this is financial sites), for others I still should use the old one.
My problem is:
these web pages have the same format, BUT old one has 2 columns - name of countries and rates, the new one has 6 columns - name of countries and 5 columns with rates for 5 days. I need to grab only first column and the sixth colums with the latest date.
My question is:
how should I exchange my code for it?
My code is:
#!/usr/local/bin/perl
print "<--- EURO cron: EXCH --->\n";
{
use Date:ateCalc qw ( calc_new_date ) ;
use HTTP::Request;
use LWP::UserAgent;
&set_date;
print "file is $file\n";
&set_url;
print "url is $url\n";
&get_url;
$number_of_tries = 0;
while ($found eq "FALSE" && $number_of_tries < 50) {
&get_url; # set $found in this function.
sleep 10; # sleep 10 seconds before trying again.
$number_of_tries += 1;
}
}
#
#
#
sub set_url {
$url = "http://www.ny.frb.org/pihome/statistics/forex12.shtml
Bookmarks