473,324 Members | 2,214 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Realtime gold price on website

Does anyone know an easy way to put a current gold price on your own
website? I've seen the graphic methods that Kitco.com offers, but I'd
rather have it pull the value from some gold market system in text format.

I found a website that's doing it, but don't know where to start in reverse
engineering the code:
http://www.goldinvestment.com/Purchasing/Scrap_Gold.asp

Thanks
Jul 22 '05 #1
12 11901
TR****@hotmail.com wrote:
Does anyone know an easy way to put a current gold price on your own
website? I've seen the graphic methods that Kitco.com offers, but I'd
rather have it pull the value from some gold market system in text format.

I found a website that's doing it, but don't know where to start in reverse
engineering the code:
http://www.goldinvestment.com/Purchasing/Scrap_Gold.asp

Thanks

you try a VIEW SOURCE to see what's rendered? There may be a clue in it.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
Jul 22 '05 #2
I'd already picked through the source, but I can't find anything that looks
like it's doing a query.

"Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
news:Og**************@TK2MSFTNGP09.phx.gbl...
TR****@hotmail.com wrote:
Does anyone know an easy way to put a current gold price on your own
website? I've seen the graphic methods that Kitco.com offers, but I'd
rather have it pull the value from some gold market system in text format.
I found a website that's doing it, but don't know where to start in reverse engineering the code:
http://www.goldinvestment.com/Purchasing/Scrap_Gold.asp

Thanks

you try a VIEW SOURCE to see what's rendered? There may be a clue in it.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

Jul 22 '05 #3


TR****@hotmail.com wrote:
Does anyone know an easy way to put a current gold price on your own
website? I've seen the graphic methods that Kitco.com offers, but I'd
rather have it pull the value from some gold market system in text format.

I found a website that's doing it, but don't know where to start in reverse
engineering the code:
http://www.goldinvestment.com/Purchasing/Scrap_Gold.asp

Here you go. Free Gold price in XML feed.

http://dgcsc.org/goldprices.htm

Jul 22 '05 #4


TR****@hotmail.com wrote:
Does anyone know an easy way to put a current gold price on your own
website? I've seen the graphic methods that Kitco.com offers, but I'd
rather have it pull the value from some gold market system in text format.

I found a website that's doing it, but don't know where to start in reverse
engineering the code:
http://www.goldinvestment.com/Purchasing/Scrap_Gold.asp

Thanks


Oh, prices are in grams.

1 ounce = 28.3495231 grams

Jul 22 '05 #5
la**********@yahoo.com wrote:


TR****@hotmail.com wrote:
Does anyone know an easy way to put a current gold price on your own
website? I've seen the graphic methods that Kitco.com offers, but I'd
rather have it pull the value from some gold market system in text format.

I found a website that's doing it, but don't know where to start in reverse
engineering the code:
http://www.goldinvestment.com/Purchasing/Scrap_Gold.asp

Thanks


Oh, prices are in grams.

1 ounce = 28.3495231 grams


I believe that's one avoirdupois ounce. But precious metals are sold
in Troy ounces.....

According to http://en.wikipedia.org/wiki/Troy_weight, one Troy ounce
is 31.103477 gram.

--
Tim Slattery
MS MVP(DTS)
Sl********@bls.gov
Jul 22 '05 #6
I can't quite figure out this last part. How do I pull the value for:
<Price currencyname="United States Dollar"
currencycode="USD">14.0788</Price>
from http://dgcsc.org/goldprices.xml and use it in my ASP code for the
variable GoldPrice_Gram? Thanks.

<%@ LANGUAGE="VBSCRIPT" %>
<%
GoldPrice_Gram = 14.0788
GramsPerTroyOunce = 31.103477
GoldPrice_Ounce = GoldPrice_Gram * GramsPerTroyOunce

response.write "Gold Price: " & round(GoldPrice_Ounce,4)
%>

"Tim Slattery" <Sl********@bls.gov> wrote in message
news:a8********************************@4ax.com...
la**********@yahoo.com wrote:


TR****@hotmail.com wrote:
Does anyone know an easy way to put a current gold price on your own
website? I've seen the graphic methods that Kitco.com offers, but I'd
rather have it pull the value from some gold market system in text format.
I found a website that's doing it, but don't know where to start in reverse engineering the code:
http://www.goldinvestment.com/Purchasing/Scrap_Gold.asp

Thanks


Oh, prices are in grams.

1 ounce = 28.3495231 grams


I believe that's one avoirdupois ounce. But precious metals are sold
in Troy ounces.....

According to http://en.wikipedia.org/wiki/Troy_weight, one Troy ounce
is 31.103477 gram.

--
Tim Slattery
MS MVP(DTS)
Sl********@bls.gov

Jul 22 '05 #7
<TR****@hotmail.com> wrote in message
news:uC**************@TK2MSFTNGP14.phx.gbl...
I can't quite figure out this last part. How do I pull the value for:
<Price currencyname="United States Dollar"
currencycode="USD">14.0788</Price>
from http://dgcsc.org/goldprices.xml and use it in my ASP code for the
variable GoldPrice_Gram? Thanks.

<%@ LANGUAGE="VBSCRIPT" %>
<%
GoldPrice_Gram = 14.0788
GramsPerTroyOunce = 31.103477
GoldPrice_Ounce = GoldPrice_Gram * GramsPerTroyOunce

response.write "Gold Price: " & round(GoldPrice_Ounce,4)
%>

"Tim Slattery" <Sl********@bls.gov> wrote in message
news:a8********************************@4ax.com...
la**********@yahoo.com wrote:


TR****@hotmail.com wrote:
> Does anyone know an easy way to put a current gold price on your own
> website? I've seen the graphic methods that Kitco.com offers, but I'd> rather have it pull the value from some gold market system in text format.>
> I found a website that's doing it, but don't know where to start in reverse> engineering the code:
> http://www.goldinvestment.com/Purchasing/Scrap_Gold.asp
>
> Thanks

Oh, prices are in grams.

1 ounce = 28.3495231 grams


I believe that's one avoirdupois ounce. But precious metals are sold
in Troy ounces.....

According to http://en.wikipedia.org/wiki/Troy_weight, one Troy ounce
is 31.103477 gram.

--
Tim Slattery
MS MVP(DTS)
Sl********@bls.gov



Will this help? Watch for word-wrap.

<%@ LANGUAGE="VBSCRIPT" %>
<% Option Explicit
'*
Const cOZT = 31.103477
Const cURL = "http://dgcsc.org/goldprices.xml"
'*
Dim iPRC
iPRC = 0.0000
'*
Dim oXML
Set oXML = CreateObject("Microsoft.XMLDOM")
oXML.async = "false"
oXML.load(cURL)
iPRC = oXML.getElementsByTagName("Price").item(21).text
Set oXML = Nothing
'*
Response.Write "Gold Price: $" & Round(iPRC * cOZT,4) & " per ounce"
%>

This assumes that "USD" is always at the same offset in the XML file.
Jul 22 '05 #8
Almost there, but it won't read the XML data if I try HTTP:
oXML.load("http://dgcsc.org/goldprices.xml")
'* Doesn't work. I hardcoded the URL just to make sure it was calling the
correct location.

oXML.load(Server.MapPath("goldprices.xml"))
'* Works perfectly. For testing purposes I copied the goldprices.xml file
from dgcsc.org into the same directly on the server as the ASP file.

Anyone got any ideas how to get this last bit to work?
Here's the complete code:

<%@ LANGUAGE="VBSCRIPT" %>
<% Option Explicit
'*
Const cOZT = 31.103477
Const cURL = "http://dgcsc.org/goldprices.xml"
'*
Dim iPRC
iPRC = 0.0000
'*
Dim oXML
Set oXML = CreateObject("Microsoft.XMLDOM")
oXML.async = "false"
'* oXML.load(cURL)
oXML.load(Server.MapPath("goldprices.xml"))
iPRC = oXML.getElementsByTagName("Price").item(21).text
Set oXML = Nothing
'*
Response.Write "Gold Price: $" & Round(iPRC * cOZT,4) & " per ounce"
%>

"McKirahan" <Ne**@McKirahan.com> wrote in message
news:i7********************@comcast.com...
<TR****@hotmail.com> wrote in message
news:uC**************@TK2MSFTNGP14.phx.gbl...
I can't quite figure out this last part. How do I pull the value for:
<Price currencyname="United States Dollar"
currencycode="USD">14.0788</Price>
from http://dgcsc.org/goldprices.xml and use it in my ASP code for the
variable GoldPrice_Gram? Thanks.

<%@ LANGUAGE="VBSCRIPT" %>
<%
GoldPrice_Gram = 14.0788
GramsPerTroyOunce = 31.103477
GoldPrice_Ounce = GoldPrice_Gram * GramsPerTroyOunce

response.write "Gold Price: " & round(GoldPrice_Ounce,4)
%>

"Tim Slattery" <Sl********@bls.gov> wrote in message
news:a8********************************@4ax.com...
la**********@yahoo.com wrote:

>
>
>TR****@hotmail.com wrote:
>> Does anyone know an easy way to put a current gold price on your own >> website? I've seen the graphic methods that Kitco.com offers, but I'd >> rather have it pull the value from some gold market system in text

format.
>>
>> I found a website that's doing it, but don't know where to start in

reverse
>> engineering the code:
>> http://www.goldinvestment.com/Purchasing/Scrap_Gold.asp
>>
>> Thanks
>
>Oh, prices are in grams.
>
>1 ounce = 28.3495231 grams

I believe that's one avoirdupois ounce. But precious metals are sold
in Troy ounces.....

According to http://en.wikipedia.org/wiki/Troy_weight, one Troy ounce
is 31.103477 gram.

--
Tim Slattery
MS MVP(DTS)
Sl********@bls.gov



Will this help? Watch for word-wrap.

<%@ LANGUAGE="VBSCRIPT" %>
<% Option Explicit
'*
Const cOZT = 31.103477
Const cURL = "http://dgcsc.org/goldprices.xml"
'*
Dim iPRC
iPRC = 0.0000
'*
Dim oXML
Set oXML = CreateObject("Microsoft.XMLDOM")
oXML.async = "false"
oXML.load(cURL)
iPRC = oXML.getElementsByTagName("Price").item(21).text
Set oXML = Nothing
'*
Response.Write "Gold Price: $" & Round(iPRC * cOZT,4) & " per ounce"
%>

This assumes that "USD" is always at the same offset in the XML file.

Jul 22 '05 #9
<TR****@hotmail.com> wrote in message
news:#c**************@TK2MSFTNGP15.phx.gbl...
Almost there, but it won't read the XML data if I try HTTP:
oXML.load("http://dgcsc.org/goldprices.xml")
'* Doesn't work. I hardcoded the URL just to make sure it was calling the
correct location.

oXML.load(Server.MapPath("goldprices.xml"))
'* Works perfectly. For testing purposes I copied the goldprices.xml file
from dgcsc.org into the same directly on the server as the ASP file.

Anyone got any ideas how to get this last bit to work?
Here's the complete code:

<%@ LANGUAGE="VBSCRIPT" %>
<% Option Explicit
'*
Const cOZT = 31.103477
Const cURL = "http://dgcsc.org/goldprices.xml"
'*
Dim iPRC
iPRC = 0.0000
'*
Dim oXML
Set oXML = CreateObject("Microsoft.XMLDOM")
oXML.async = "false"
'* oXML.load(cURL)
oXML.load(Server.MapPath("goldprices.xml"))
iPRC = oXML.getElementsByTagName("Price").item(21).text
Set oXML = Nothing
'*
Response.Write "Gold Price: $" & Round(iPRC * cOZT,4) & " per ounce"
%>

"oXML.load(cURL)" works for me.

How do you know "it won't read"?

Try adding this line after "oXML.load(cURL)"

Response.Write "nodeName = " & oXML.documentElement.nodeName & "<br>"

(Watch for word-wrap.)
Jul 22 '05 #10
Adding Response.Write "nodeName = " & oXML.documentElement.nodeName & "<br>"
after oXML.load(cURL) gives me an error:
Object required: 'documentElement'

It seems like I had to add an extra step to get it to work, which I don't
like as your's is cleaner. Do you have any ideas as to why this was
necessary or any further steps in trouble shooting?

set objHTTP = Server.CreateObject("Microsoft.XMLHTTP")

objHTTP.open "GET", cURL, false
objHTTP.send
set objXML = objHTTP.responseXML

Complete code:
<%@ LANGUAGE="VBSCRIPT" %>
<% Option Explicit
'*
Const cOZT = 31.103477
Const cURL = "http://dgcsc.org/goldprices.xml"
'*
Dim iPRC, objHTTP, objXML, oXML
iPRC = 0.0000
'*

set objHTTP = Server.CreateObject("Microsoft.XMLHTTP")

objHTTP.open "GET", cURL, false
objHTTP.send
set objXML = objHTTP.responseXML

set oXML=CreateObject("Microsoft.XMLDOM")
oXML.async= "false"
oXML.load(objXML)
iPRC = oXML.getElementsByTagName("Price").item(21).text
Set oXML = Nothing
'*
Response.Write "Gold Price: $" & Round(iPRC * cOZT,4) & " per ounce"
%>

"McKirahan" <Ne**@McKirahan.com> wrote in message
news:E7********************@comcast.com...
<TR****@hotmail.com> wrote in message
news:#c**************@TK2MSFTNGP15.phx.gbl...
Almost there, but it won't read the XML data if I try HTTP:
oXML.load("http://dgcsc.org/goldprices.xml")
'* Doesn't work. I hardcoded the URL just to make sure it was calling the correct location.

oXML.load(Server.MapPath("goldprices.xml"))
'* Works perfectly. For testing purposes I copied the goldprices.xml file from dgcsc.org into the same directly on the server as the ASP file.

Anyone got any ideas how to get this last bit to work?
Here's the complete code:

<%@ LANGUAGE="VBSCRIPT" %>
<% Option Explicit
'*
Const cOZT = 31.103477
Const cURL = "http://dgcsc.org/goldprices.xml"
'*
Dim iPRC
iPRC = 0.0000
'*
Dim oXML
Set oXML = CreateObject("Microsoft.XMLDOM")
oXML.async = "false"
'* oXML.load(cURL)
oXML.load(Server.MapPath("goldprices.xml"))
iPRC = oXML.getElementsByTagName("Price").item(21).text
Set oXML = Nothing
'*
Response.Write "Gold Price: $" & Round(iPRC * cOZT,4) & " per ounce"
%>

"oXML.load(cURL)" works for me.

How do you know "it won't read"?

Try adding this line after "oXML.load(cURL)"

Response.Write "nodeName = " & oXML.documentElement.nodeName & "<br>"

(Watch for word-wrap.)

Jul 22 '05 #11
<TR****@hotmail.com> wrote in message
news:ep**************@TK2MSFTNGP10.phx.gbl...
Adding Response.Write "nodeName = " & oXML.documentElement.nodeName & "<br>" after oXML.load(cURL) gives me an error:
Object required: 'documentElement'

It seems like I had to add an extra step to get it to work, which I don't
like as your's is cleaner. Do you have any ideas as to why this was
necessary or any further steps in trouble shooting?

set objHTTP = Server.CreateObject("Microsoft.XMLHTTP")

objHTTP.open "GET", cURL, false
objHTTP.send
set objXML = objHTTP.responseXML


[snip]

What's your O/S (+ version) and browser (+ version)?

For example, Win98SE and IE5.5 or WinXPPro and IE6.0.
Jul 22 '05 #12
W2K Server SP4 & IE 6 (all updates)
XPpro SP2 & IE 6 (all updates)

"McKirahan" <Ne**@McKirahan.com> wrote in message
news:Ec********************@comcast.com...
<TR****@hotmail.com> wrote in message
news:ep**************@TK2MSFTNGP10.phx.gbl...
Adding Response.Write "nodeName = " & oXML.documentElement.nodeName &

"<br>"
after oXML.load(cURL) gives me an error:
Object required: 'documentElement'

It seems like I had to add an extra step to get it to work, which I don't like as your's is cleaner. Do you have any ideas as to why this was
necessary or any further steps in trouble shooting?

set objHTTP = Server.CreateObject("Microsoft.XMLHTTP")

objHTTP.open "GET", cURL, false
objHTTP.send
set objXML = objHTTP.responseXML


[snip]

What's your O/S (+ version) and browser (+ version)?

For example, Win98SE and IE5.5 or WinXPPro and IE6.0.

Jul 22 '05 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Rafa³ | last post by:
Hi. Timer in C# not work, Thread + Loop + Sleep + DateTime.Now too not work (Process.Prioritet = RealTime) What i do wrong? Best regards. Rafal
0
by: plselina011 | last post by:
MMOPAWN is an exchange site designed specifically for game virtual currencies and items trading. We are trading mmorpg virtual currency ,world of warcraft account or goods with all of the...
0
by: julieook | last post by:
you can buy the cheapest lotro gold in our website http://www.wowmmocom.com,we'll provid you the reliable and instant delivery our msn: julieook@hotmail.com website: http://www.wowmmocom.com
0
by: julieook | last post by:
our msn: julieook@hotmail.com website: http://www.wowmmocom.com you can buy the cheapest lotro gold in our website http://www.wowmmocom.com,we'll provid you the reliable and instant delivery
0
by: juliemmo | last post by:
http://www.wowmmocom.com http://www.wowmmocom.com you can buy the cheapest lotro gold in our website http://www.wowmmocom.com,we'll provid you the reliable and instant delivery our msn: ...
0
by: wowmmocom.com | last post by:
http://www.wowmmocom.com http://www.wowmmocom.com you can buy the cheapest lotro gold in our website http://www.wowmmocom.com,we'll provid you the reliable and instant delivery our msn: ...
0
by: aries4175 | last post by:
Can someone help me with the code fragment to add real-time gold price to my website. I cant seem to find away of getting it right. Thanks
1
by: Jassim Rahma | last post by:
I am looking for a free realtime webservices for my ASP.NET website to display oil prices> anyone came across such service?
3
by: santoshsri | last post by:
Hi , I have a requirement in which the client's portfolio's net worth should change dynamically based on current price of Gold and silver. Please advise how can I get this done. Thanks !!
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.