Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Need to get daily value of 1 dollar in Euro and British Pound

Posted on 2011-04-29
7
Medium Priority
?
278 Views
Last Modified: 2012-05-11
I would like to know if there is a way for me to schedule a task to grab the value of the British Pound and Euro for $1 USD.   So for example, today the GPB is .60 and the Euro is .67.  I found that on a website, but  I am wondering if anyone has used a website to grab that value every day.
0
Comment
Question by:theideabulb
  • 4
  • 2
7 Comments
 

Author Comment

by:theideabulb
ID: 35494314
right, i found plenty of sites that can convert for me, but I am looking to grab it automatically everyday.  I am not sure how I would grab stuff from that page.
0
 
LVL 53

Expert Comment

by:_agx_
ID: 35494352
I haven't used that site myself, but like most they offer data feeds.  Once you sign up (some charge a fee) they provide data feeds in various formats.  That site offers:  xml, csv, html.  
http://www.xe.com/dfs/product.php

They probably give you a url and access key. Then you can use cfhttp to grab the data from their site every day. It's pretty simple.
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
LVL 53

Accepted Solution

by:
_agx_ earned 2000 total points
ID: 35494460
Obviously the final code'll depend on the site you choose and the format of their feed. But here's an example using xe.com's  sample xml feed:

<cfhttp url="http://www.xe.com/dfs/sample-usd.xml" method="get"/>
<cfif cfhttp.statusCode eq "200 OK">
	<cfset results = xmlParse(cfhttp.fileContent)>
	<cfset myRate = xmlSearch(results, "/xe-datafeed/currency[csymbol = 'GBP']")>
	<!--- needs error handling --->
	<cfoutput>
		CSymbol: #myRate[1].csymbol.xmlText#<br>
		CName: #myRate[1].cname.xmlText#<br>
		CRate: #myRate[1].crate.xmlText#<br>
		CInverse: #myRate[1].cinverse.xmlText#<br>
	</cfoutput>
<cfelse>
	something went wrong. do something with the error
	<cfdump var="#cfhttp#">	
</cfif>

Open in new window

0
 
LVL 12

Expert Comment

by:Amick
ID: 35494495
Note that the terms of use for xe.com prohibit automated extraction from their public page.

You may already be aware that Microsoft has shipped a connection to MSN MoneyCentral Investor Currency Rates with Excel for some time.

In Excel 2007 go to the Data tab, select Existing Connections, then select MSN MoneyCentral Investor Currency Rates, enter the target cell and press OK.  If you accept A1 as the starting cell, Euros expressed as US dollars should be found at B17, and British Pounds at B10.  The inverse is found in column C.

0
 
LVL 53

Expert Comment

by:_agx_
ID: 35494577
Note that the terms of use for xe.com prohibit automated extraction from their public page.

Good point.  

BTW: The code was just an example. I was *not* suggesting anyone scrape their main site. That's why I mentioned having to sign up (pay a fee) and most likely being provided with a private url and access key.
0
 
LVL 53

Expert Comment

by:_agx_
ID: 35494598
.... and note the url is just a static sample page (http://www.xe.com/dfs/sample-usd.xml) it's not a live feed.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

PROBLEM: How to add your own buttons to the bottom toolbar with paging info ( result count ). While creating a cfgrid, I ran into an issue where I wanted to embed my own custom buttons where the default ones ( insert / delete / etc… ) are for aes…
Today, I was working on some optimization and spam-stopping techniques when I encountered Ben Nadel's post to reduce spam feature using Math (http://www.bennadel.com/blog/197-How-I-Stop-Spammers-On-My-ColdFusion-Blog.htm). While this method is not o…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Screencast - Getting to Know the Pipeline
Suggested Courses

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question