Is there a way to import Exchange rates automatically?

Hi I want to show product prices in many currencies Is there a way to import Exchange rates automatically? Thanks Erez

If you can find a web service that has the data you need, you can import it to your application easily.

Since exchange rates is something that changes daily, importing once will not work as expected, it has to be something that will allow you to update it frequently (daily probably).

Thanks felipekk This is a web service I want to conect to: http://www.bankisrael.gov.il/heb.shearim/currency.php?curr=01 how do i do it? Erez

What do you have so far? Where are you getting stuck?

Hi George My app is about Real Estate I show assets prices is NIS and I want to show prices in Dollars also

<div class="price"><%=h number_to_currency(@asset.price_shekel, :unit => "₪") %></div> <div class="price"><%=h number_to_currency(@asset.price_shekel.to_f / @dolar.to_f) %></div>

@dolar = 3.425

I need to import (automatically) the Dollar rate once a day and store it in my app DB <RATE>3.425</RATE>

i am sure this is simple how ever I am new to programing

Thanks

Erez

When programming, the way to solve a large problem is to break it down into smaller pieces, and then solve those smaller problems. Right now you want to "import exchange rates."

You should break that up into something like:

- connect to the server - log in - send request - receive reply - parse reply - store reply

It may be that even some of those smaller problems should be broken into even smaller pieces. The code you posted above is only the presentation of the data. Before you can present it you've got to do all those other things, and probably a few more that I didn't list.

More about this here:

Erez