Giter VIP home page Giter VIP logo

Comments (5)

jgarber avatar jgarber commented on September 1, 2024

I've got $100 for anyone who can replicate it and show a solution (not just a workaround).

from currencies.

jgarber avatar jgarber commented on September 1, 2024

Here's the smallest bit of code that will produce the inconsistent results. It only does it on my production server, not on my development machine (not even in production mode).

rails@li354-33:/srv/tinefcon-orders/current$ ./script/console production
Loading production environment (Rails 2.3.8)
>> ["AUD", "CAD", "EUR", "HKD", "PLN", "RUB", "ZAR", "GBP", "USD"].map {|c| ISO4217::Currency.from_code(c).exchange_rate }
=> [1.0, 0.6493, 0.8819, 0.0787, 0.2209, 0.0221, 1.0, 1.0, 505571776.0]
>> ["AUD", "CAD", "EUR", "HKD", "PLN", "RUB", "ZAR", "GBP", "USD"].map {|c| ISO4217::Currency.from_code(c).exchange_rate }
=> [1.0, 0.6493, 0.8819, 0.0787, 0.2209, 0.0221, 1.0, 1.0, 505571776.0]
>> exit
rails@li354-33:/srv/tinefcon-orders/current$ ./script/console production
Loading production environment (Rails 2.3.8)
>> ["AUD", "CAD", "EUR", "HKD", "PLN", "RUB", "ZAR", "GBP", "USD"].map {|c| ISO4217::Currency.from_code(c).exchange_rate }
=> [0.665, 0.6493, 0.8819, 0.0787, 1.0, 0.0221, 0.0906, 1.0, 0.6135]
>> exit

from currencies.

jgarber avatar jgarber commented on September 1, 2024

Mystery solved. It's actually coming from Yahoo that way.

?> ["AUD", "CAD", "EUR", "HKD", "PLN", "RUB", "ZAR", "GBP", "USD"].each {|c| puts get_yahoo_response(c) }
"AUDGBP=X",1.00,"N/A","N/A"
"CADGBP=X",0.6494,"7/21/2011","12:59pm"
"EURGBP=X",0.8821,"7/21/2011","12:59pm"
"HKDGBP=X",0.0787,"7/21/2011","12:59pm"
"PLNGBP=X",1.00,"N/A","N/A"
"RUBGBP=X",1.00,"N/A","N/A"
"ZARGBP=X",1.00,"N/A","N/A"
"GBPGBP=X",1.00,"N/A","N/A"
"USDGBP=X",0.6134,"7/21/2011","12:59pm"

Now to figure out why.

from currencies.

jgarber avatar jgarber commented on September 1, 2024

I'm going to use https://github.com/RubyMoney/eu_central_bank instead. So long and thanks for all the fish.

from currencies.

hexorx avatar hexorx commented on September 1, 2024

Sorry for the slow response, I have been planning my wedding and very swamped. I will take a look at Yahoo and see if they changed something or are just mucking it up.

from currencies.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.