How to Download Historical Exchange Rate Data Using Perl

I wrote this script for myself, and being a Canadian, I’m converting each foreign currency into Canadian dollars.

Given a csv file which has on each line the foreign currency and the date in the format shown in Example Input Data, the Perl script looks up the exchange rate information and generates a csv file as output.

It took 10 seconds to get the data from 100 pages.

If you want exchange rate data like this, you can use this script too, or modify it for your own purposes.

If you’d like me to modify this, or create a custom script for you, let me know. I am available for hire as a freelancer on UpWork. My profile is here.

Example Output Data:


usd,2017_01_01,1.3429
usd,2017_01_02,1.34418
usd,2017_01_03,1.34215
...

Example Input Data:


usd,2017_01_01
usd,2017_01_02
usd,2017_01_03
...

Download the Perl Script + Example Input and Output (Zip file)

I’m using ActivePerl.

By downloading this software, you agree to the following:

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

My best,

Bevan

 

About Bevan Bird

You too can Become An Office Superhero, by bringing me into your organization, like my friend Steve did! I am on a mission to help as many people as possible to Position themselves on Purpose, so they use their greatest gift, their genius superpower, and be rewarded justly for this. I believe that together we can create Heaven on Earth and everyone can have Abundance! I am a Custom Software Developer and a Certified Joint Venture Specialist. I've been professionally producing software that gives my clients a Competitive Advantage since 2013. The greatest Leverage is bringing the right people together to Collaborate, and this is what I do, while I travel the world... sharing highlights from my journey to Inspire my friends. Connect with me on LinkedIn.
This entry was posted in Web Scraping. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CommentLuv badge