Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Realtime gold price on website

Reply
Thread Tools

Realtime gold price on website

 
 
Guest
Posts: n/a
 
      06-17-2005
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


 
Reply With Quote
 
 
 
 
Curt_C [MVP]
Guest
Posts: n/a
 
      06-17-2005
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
 
Reply With Quote
 
 
 
 
Guest
Posts: n/a
 
      06-18-2005
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:...
> 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



 
Reply With Quote
 
larrybud2002@yahoo.com
Guest
Posts: n/a
 
      06-20-2005


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

 
Reply With Quote
 
larrybud2002@yahoo.com
Guest
Posts: n/a
 
      06-20-2005


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

 
Reply With Quote
 
Tim Slattery
Guest
Posts: n/a
 
      06-20-2005
wrote:

>
>
> 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)

 
Reply With Quote
 
Guest
Posts: n/a
 
      06-21-2005
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" <> wrote in message
news:...
> wrote:
>
> >
> >
> > 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)
>



 
Reply With Quote
 
McKirahan
Guest
Posts: n/a
 
      06-22-2005
<> wrote in message
news:...
> 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" <> wrote in message
> news:...
> > wrote:
> >
> > >
> > >
> > > 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)
> >

>
>


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.


 
Reply With Quote
 
Guest
Posts: n/a
 
      06-22-2005
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" <> wrote in message
news:i7-dnTJ9-_ERKyXfRVn-...
> <> wrote in message
> news:...
> > 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" <> wrote in message
> > news:...
> > > wrote:
> > >
> > > >
> > > >
> > > > 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)
> > >

> >
> >

>
> 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.
>
>



 
Reply With Quote
 
McKirahan
Guest
Posts: n/a
 
      06-22-2005
<> wrote in message
news:#c4DE$...
> 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.)


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
realtime oil price webservices? Jassim Rahma ASP .Net 1 07-14-2008 06:37 PM
Online price vs retail store price? Squiggle NZ Computing 74 12-07-2007 03:44 AM
computer spares price list | newly added Canada country price list| Nandhu Python 0 12-04-2007 02:56 PM
US price v Uk price /\\BratMan/\\ Digital Photography 19 11-23-2007 05:18 AM
Vista Ultimate: NZ price vs US Price whome NZ Computing 61 02-03-2007 12:11 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57