/ Published in: ASP

There are free exchange rates data that are easy to retrieve and parse, here is the code of a mini webbot written in ASP that goes out on Bank of Italy site, get the exchanges rates and print them.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<% Dim yesterday yesterday = dateadd("d",-1,date) Dim objHttp Set objHttp = Server.CreateObject("Microsoft.XMLHTTP") objHttp.Open "GET", "http://uif.bancaditalia.it/UICFEWebroot/QueryOneDateAllCur?lang=en&rate=0&initDay=" & Day(yesterday) & "&initMonth=" & Month(yesterday) & "&initYear=" & Year(yesterday) & "&refCur=euro&R1=csv", False objHttp.Send If objHttp.Status = 200 Then Dim arrLines Dim arrFields Dim i arrLines = Split(objHttp.ResponseText,Chr(10)) For i = 0 To UBound(arrLines)-1 If i >= 4 then arrFields = Split(arrLines(i),",") response.write arrFields(4) & " " & arrFields(1) & " (" & arrFields(2) & ") per 1 EUR<br/>" End if Next Else Response.Write(objHttp.Status & " - " & objHttp.StatusText) End If Set objHttp = Nothing %>
URL: http://www.barattalo.it/2009/12/23/asp-web-bot-exchange-rates/
Comments
