# Is there a way to import Exchange rates automatically?

**URL:** <https://www.ruby-forum.com/t/is-there-a-way-to-import-exchange-rates-automatically/135214>\
**Category:** Rails\
**Created:** [April 19, 2008, 8:33am UTC](https://www.ruby-forum.com/t/is-there-a-way-to-import-exchange-rates-automatically/135214 "2008-04-19T08:33:44Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 19, 2008, 8:33am UTC](https://www.ruby-forum.com/t/is-there-a-way-to-import-exchange-rates-automatically/135214/1 "2008-04-19T08:33:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 19, 2008, 11:58am UTC](https://www.ruby-forum.com/t/is-there-a-way-to-import-exchange-rates-automatically/135214/2 "2008-04-19T11:58:14Z")

</div>

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).

On Apr 18, 11:33 pm, “removed\_email\_address@domain.invalid” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 19, 2008, 11:27pm UTC](https://www.ruby-forum.com/t/is-there-a-way-to-import-exchange-rates-automatically/135214/3 "2008-04-19T23:27:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 20, 2008, 9:48am UTC](https://www.ruby-forum.com/t/is-there-a-way-to-import-exchange-rates-automatically/135214/4 "2008-04-20T09:48:17Z")

</div>

On Apr 19, 2008, at 3:26 PM, removed\_email\_address@domain.invalid wrote:

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

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

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 20, 2008, 5:01pm UTC](https://www.ruby-forum.com/t/is-there-a-way-to-import-exchange-rates-automatically/135214/5 "2008-04-20T17:01:31Z")

</div>

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

\<%=h number\_to\_currency(@asset.price\_shekel, :unit =\> "â‚ª") %\>

\<%=h number\_to\_currency(@asset.price\_shekel.to\_f / @dolar.to\_f) %\>

@dolar = 3.425

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

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

Thanks

Erez

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [May 24, 2008, 5:58pm UTC](https://www.ruby-forum.com/t/is-there-a-way-to-import-exchange-rates-automatically/135214/6 "2008-05-24T17:58:20Z")

</div>

More about this here:

> **[SitePoint Forums | Web Development & Design Community](https://www.sitepoint.com/community/)**
>
> A community for web designers and developers to discuss everything from HTML, CSS, JavaScript, PHP, to Photoshop, SEO and more.

Erez

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 20, 2008, 6:08pm UTC](https://www.ruby-forum.com/t/is-there-a-way-to-import-exchange-rates-automatically/135214/7 "2008-04-20T18:08:02Z")

</div>

On Apr 20, 2008, at 9:01 AM, removed\_email\_address@domain.invalid wrote:

> @dolar = 3.425
> 
> I need to import (automatically) the Dollar rate once a day and store  
> it in my app DB  
> 3.425
> 
> i am sure this is simple how ever I am new to programing

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.
