Magento Forum

   
Page 1 of 3
Now Available: Yahoo! Finance as a source for Currency Exchange Rates
 
J_T_
Mentor
 
Avatar
Total Posts:  1961
Joined:  2008-08-07
London-ish, UK
 

Full write-up here:

http://www.magentocommerce.com/wiki/how_to/using_yahoo_finance_for_currency_exchange_rate_retrieval

If you’ve had it with Webservicex’s slow servers and lack of support for currencies such as BGN, it’s time to move over to a company who has 100% uptime and 100% speed guarantee (pretty much anyway). Yahoo does not suffer from capacity problems so switch if you need reliable currency exchange rate importing.

Manual import has been tested to work in 1.2.1. Cron import not yet, as my domain’s Nameservers are being tricked with during development. If someone can confirm the cron works too, I’d be much obliged.

Feel free to discuss in the wiki or here in this thread.

 
Magento Community Magento Community
Magento Community
Magento Community
 
J_T_
Mentor
 
Avatar
Total Posts:  1961
Joined:  2008-08-07
London-ish, UK
 

I’ve added an “exchange rate influencer” which allows you to multiply the exchange rate by anything above or below 1.0 so you can reduce the difference between market rates and bank rates. Banks typically have a 2-4% profit margin on it and without adapting your rates accordingly, people browsing your shop may think you are pocketing this difference. See “Advanced Usage” on the wiki for more info and instructions.

Performance-wise, it’s pulling in 23 exchange rates for me in 40 seconds. It has never timed out once.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Amin Amini
Member
 
Total Posts:  67
Joined:  2008-04-17
Sweden, Stockholm
 

This is good news - great work J.T! I’m, however, wondering if Yahoo’s TOS allows companies to use this service for commercial purposes.

I will try this out and report back.

Regards,
Amin Amini

 
Magento Community Magento Community
Magento Community
Magento Community
 
Amin Amini
Member
 
Total Posts:  67
Joined:  2008-04-17
Sweden, Stockholm
 

I’ve followed the steps but the Yahoo doesn’t show up in the currency drop down menu. There are no errors reported.

 
Magento Community Magento Community
Magento Community
Magento Community
 
J_T_
Mentor
 
Avatar
Total Posts:  1961
Joined:  2008-08-07
London-ish, UK
 

I’m, however, wondering if Yahoo’s TOS allows companies to use this service for commercial purposes.

Which is why I mentioned that in the notes. I’m trying to work it out (again) but their new currency tool does not show the information it used to. You used ot be able to do the conversion and then click to get the CSV (which is what the code uses). The CSV URL is still available but the link to it is what I currently can’t find.

It’s a bit stupid how that site is now as it has Yahoo! Answers in the footer, totally random.

Their only applicable disclaimer I can see on the actual page is:

All information provided “as is” for informational purposes only, not intended for trading purposes or advice. Neither Yahoo! nor any of independent providers is liable for any informational errors, incompleteness, or delays, or for any actions taken in reliance on information contained herein. By accessing the Yahoo! site, you agree not to redistribute the information found therein.

That’s fine as nothing is redistributed and the info is indeed used for informational purposes only.

Whether or not you think section 12 of their T’s & C’s prohibits you is up to you and your lawyer:

http://info.yahoo.com/legal/us/yahoo/utos/utos-173.html

NO COMMERCIAL REUSE OF YAHOO! SERVICES

You agree not to reproduce, duplicate, copy, sell, trade, resell or exploit for any commercial purposes, any portion or use of, or access to, the Yahoo! Services (including Content, advertisements, Software and your Yahoo! ID).

Many others have written software to systematically use their data (not an excuse for you to use it):

http://search.cpan.org/search?mode=module&query;=Finance::Currency::Convert::Yahoo

But really, why would they make it available in a one-cell CSV if it wasn’t intended for automation? What good is a no-header, one-cell CSV file to an end-user?

Anyone is of course free to use the NY Fed Bank instead: http://www.newyorkfed.org/markets/pilotfx.html

Or Coinmill’s feed: http://coinmill.com/rss/AUD_USD.xml

Regarding the issue, let me double-check my notes. Did you flush your configuration cache?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Amin Amini
Member
 
Total Posts:  67
Joined:  2008-04-17
Sweden, Stockholm
 
Amin Amini - 17 February 2009 04:53 AM

I’ve followed the steps but the Yahoo doesn’t show up in the currency drop down menu. There are no errors reported.

Solved. The local.xml code has to be inside the <global> element, at the very end, and not after it as I thought. I’ve already changed the Wiki to clarify this.

I’ve tried fetching exchange rates and it works flawlessly. I cannot say anything about performance because I’m still running my shop in dev mode (it’s not optimized at all, cache is disabled, etc), but Webservicex actually timed out on me when I tried it a couple of minutes ago, so Yahoo pretty much rocks in comparison wink

 
Magento Community Magento Community
Magento Community
Magento Community
 
J_T_
Mentor
 
Avatar
Total Posts:  1961
Joined:  2008-08-07
London-ish, UK
 

Thanks!

I’ve made it even more clear but yes, useful additional, thanks for adding it. Also added about possible requiring cache flush.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Amin Amini
Member
 
Total Posts:  67
Joined:  2008-04-17
Sweden, Stockholm
 
J.T. - 17 February 2009 05:01 AM

I’m, however, wondering if Yahoo’s TOS allows companies to use this service for commercial purposes.

Which is why I mentioned that in the notes. I’m trying to work it out (again) but their new currency tool does not show the information it used to. You used ot be able to do the conversion and then click to get the CSV (which is what the code uses). The CSV URL is still available but the link to it is what I currently can’t find.

It’s a bit stupid how that site is now as it has Yahoo! Answers in the footer, totally random.

Their only applicable disclaimer I can see on the actual page is:

All information provided “as is” for informational purposes only, not intended for trading purposes or advice. Neither Yahoo! nor any of independent providers is liable for any informational errors, incompleteness, or delays, or for any actions taken in reliance on information contained herein. By accessing the Yahoo! site, you agree not to redistribute the information found therein.

That’s fine as nothing is redistributed and the info is indeed used for informational purposes only.

Whether or not you think section 12 of their T’s & C’s prohibits you is up to you and your lawyer:

http://info.yahoo.com/legal/us/yahoo/utos/utos-173.html

NO COMMERCIAL REUSE OF YAHOO! SERVICES

You agree not to reproduce, duplicate, copy, sell, trade, resell or exploit for any commercial purposes, any portion or use of, or access to, the Yahoo! Services (including Content, advertisements, Software and your Yahoo! ID).

Many others have written software to systematically use their data (not an excuse for you to use it):

http://search.cpan.org/search?mode=module&query;=Finance&#x3A;&#x3A;Currency&#x3A;&#x3A;Convert&#x3A;&#x3A;Yahoo

But really, why would they make it available in a one-cell CSV if it wasn’t intended for automation? What good is a no-header, one-cell CSV file to an end-user?

Anyone is of course free to use the NY Fed Bank instead: http://www.newyorkfed.org/markets/pilotfx.html

Or Coinmill’s feed: http://coinmill.com/rss/AUD_USD.xml

Regarding the issue, let me double-check my notes. Did you flush your configuration cache?

Good argumentation, you got me convinced.

I’m speculating a bit but I think that most Magento stores have too few currencies enabled to generate noticable traffic. Heck, even with dozens of currencies that are updated once a day, Yahoo won’t notice the traffic. So if Yahoo will have any issues with this module, it won’t atleast be traffic related.

 
Magento Community Magento Community
Magento Community
Magento Community
 
J_T_
Mentor
 
Avatar
Total Posts:  1961
Joined:  2008-08-07
London-ish, UK
 

Exactly. Part of their TOS says you are not allowed to affect their servers badly. With 23 currencies enabled, they get 23 calls in about 25 seconds. To their httpd logs, its a needle in a haystack. It’s a drop in the ocean.

It’s no real difference to me running the manual tool (which loads all the graphical overheads) 23 times and manually inputting it. That would cost them much more in bandwidth and computational resources. This code is doing them a favour :D

You are allowed to load all YUI libraries straight from their servers and they have great APIs for tons of other stuff. Can’t see why this would be an issue. But assuming is never a good thing.

Anyway, each can decide for themselves whether to use it, whether to increase the sleep() period and whether to ask for permission in writing.

 
Magento Community Magento Community
Magento Community
Magento Community
 
joolsr
Sr. Member
 
Total Posts:  99
Joined:  2008-01-16
 

Hi

Couple of questions.

I’m still running 1.1.6 , is it likely to install ok, or do I need vers 1.2.1 ?

Secondly, as its file changes, if I upgrade my Magento site, is it possible that these changes of yours could get overwritten? I haven’t read your wiki post in depth, so I apologise if the answers are in there regarding this.

Julian

 
Magento Community Magento Community
Magento Community
Magento Community
 
J_T_
Mentor
 
Avatar
Total Posts:  1961
Joined:  2008-08-07
London-ish, UK
 

Should run OK on 1.1.6 but really, you should consider upgrading anyway.

As per the wiki smile the files are all local so any core upgrades will do nothing to this code. At worst, the Yahoo options disappears or don’t work. But this will never bring down the rest of your installation as it’s contained within the local folder structure.

 
Magento Community Magento Community
Magento Community
Magento Community
 
GonzagueGB
Jr. Member
 
Total Posts:  29
Joined:  2008-08-27
 

Installed, followed everything to the letter, flushed the cache twice but each time when I try to import I have thi error

Fatal error: Call to a member function fetchRates() on a non-object in /home/XXXX_v3/app/code/core/Mage/Adminhtml/controllers/System/CurrencyController.php on line 75

On line 75 of CurrencyConttroller.php I have this

$rates = $importModel->fetchRates();

Does Anyone has an Idea? J.T seems to be dead busy (Good luck with your install man !)

Cheers

 
Magento Community Magento Community
Magento Community
Magento Community
 
kiatng
Enthusiast
 
Total Posts:  875
Joined:  2008-09-03
Kuala Lumpur, Malaysia
 

Thank you J.T. It works beautifully on Ver 1.2.1.2.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Inspired33
Jr. Member
 
Total Posts:  19
Joined:  2009-03-06
 

Thanks JT.
One question though…
I have no folders beyond… /app/code/local/

Nothing under that.
I have Mag 1.2.1.2

Can I go ahead and follow your instructions or will they not apply in my case?
Not sure why my set up is different though.

Cheers,

Jonathan

 
Magento Community Magento Community
Magento Community
Magento Community
 
Inspired33
Jr. Member
 
Total Posts:  19
Joined:  2009-03-06
 

Okay… I installed as per instructions. All went well.

Thanks so much for this. Looks like it’ll work, and get me away from this crappy webservicesx service.

Jonathan

 
Magento Community Magento Community
Magento Community
Magento Community
 
ashish96
Member
 
Avatar
Total Posts:  63
Joined:  2009-01-21
Gujarat, India
 

@J.T.
if i want any other webservice get working in magento,
what to do? question
all the steps of yahoo finance, you described, are sufficient or do i need to do more coding?
thnx

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
Page 1 of 3