hi there I have a website that calls an rss.xml to change the currency from us to canadian if they choose...I am not a programmer and have no idea how to fix....Iam providing the code below if anyone can give me some insight I would greatly appreciate it...if you need the full url for the site let me know thanks again function to get currency exchange rate from RSS feed
function getCurrency( sCurrency )
sBasePrice = "USD"
//sBasePrice = "CAD"
Response.Charset = "UTF-8"
Dim objXML
Dim objItemList
Dim objItem
Dim nCurrency
Set objXML = Server.CreateObject( "MSXML2.FreeThreadedDOMDocument" )
objXML.async = False
objXML.setProperty "ServerHTTPRequest", True
objXML.Load( "http://currencysource.com/RSS/" & sBasePrice & ".xml" )
' set currency exchange rate to 1 CAD = 1 USD if error with RSS feed
nCurrency = 1
' no errors
If objXML.parseError.errorCode = 0 Then
Set objItemList = objXML.getElementsByTagName( "item" )
Set objXML = Nothing
'RSS Feed childNodes: 0=title, 1=link, 2=description, 3=pubdate
For Each objItem In objItemList
' check if current item is USD
' 1 CAD = USD (0.861966)
if Mid( objItem.childNodes( 0 ).text, 1, 11 ) = "1 " & sBasePrice & " = " & sCurrency then
nCurrency = Left( Mid( objItem.childNodes( 0 ).text, 14 ), Len( Mid( objItem.childNodes( 0 ).text, 14 ) ) - 1 )
exit for
end if
Next
Set objItemList = Nothing
End If
getCurrency = nCurrency
end function