paulodiniz / xe

Realtime currency conversion for Elixir
22 stars 2 forks source link

Provide a historical mid-market rates with daily granularity. #15

Open mtwilliams opened 8 years ago

mtwilliams commented 8 years ago

Simple enough. Fetch the historical rate table by making a GET request in the form of http://www.xe.com/currencytables/?from=<currency>&date=<date as yyyy-mm-dd>, for example: EUR on 2010-02-01. Find the relevant row by looking at .//tr/td[1]/a/text() and extract the rates via the last two cells (classed with ICTRate).

mtwilliams commented 8 years ago

I'm thinking something like

Xe.rates(:usd, :cad, on: Timex.date({2006, 5, 15}))

Thoughts, @paulodiniz?