[ic] URGENT exchange rate usertag
daniel castro
daniel_castro at hotmail.com
Mon May 9 07:52:57 EDT 2005
Hi List,
I am trying to use the exchange rate posted on the list a few weeks ago. But
the user tag is returning empty, so I cannot update my locale table, the
user tag is like this, I am sure there is something wrong in the code,
because it was working a few days ago.
My code is this:
UserTag exchange-rate Order currency
UserTag exchange-rate PosNumber 1
UserTag exchange-rate Routine <<EOR
sub {
my ($currency) = @_;
my $url;
if ($currency eq 'EUR') {
$url =
'http://finance.yahoo.com/currency/convert?amt=1&from=COP&to=EUR&submit=Convert';
}
if ($currency eq 'USD'){
$url =
'http://finance.yahoo.com/currency/convert?amt=1&from=COP&to=USD&submit=Convert';
}
else {
$url =
'http://finance.yahoo.com/currency/convert?amt=1&from=USD&to=COP&submit=Convert';
}
use LWP::Simple;
my $content = get $url;
#die "Couldn't get $url" unless defined $content;
$content =~ /(\d\.\d{2,5})(.........)/;
$Scratch->{rate} = $1;
return $1;
exit;
}
EOR
Please I need some help with this, it is supposed to be working for today!!!
Thanks
Daniel
More information about the interchange-users
mailing list