You can use a SOAP service to get the data you need. After a quick Google search, I found a web service to do the work for you. You'll have to have SOAP::Lite installed, though. You can get it from CPAN if you don't. See www.soaplite.com for more info.
Instead of just giving you the exchange rate, however, it gives you a string containing both the exchange rate and the time at which it was valid. You'll have to get the exchange rate off the end of the string. Since you said you wanted to "create a program," I'll leave that part as an exercise for the reader. :-)
You'll want to use the currency codes USD and JPY for US dollars to Japanese yen. See the service home page for more currencies and service specifics.
use SOAP::Lite; die "gimme some currency codes" unless @ARGV == 2; my ($from,$to) = @ARGV; my $rate_str = SOAP::Lite ->proxy('http://www.itfinity.net:8080/soap/exrates/default.asp') ->endpoint('http://www.itfinity.net:8008/soap/exrates/default.asp') ->uri('http://www.itfinity.net/soap/exrates/exrates.xsd') ->GetRate( SOAP::Data->type('string')->name( fromCurr => $from ), SOAP::Data->type('string')->name( ToCurr => $to ), ) ->result; print "$rate_str\n";
In reply to Re: Currency Exchange Rate Programming
by Philgarr
in thread Currency Exchange Rate Programming
by bladx
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |