Dim strPost As String
Dim objHTTP, replyTXT As String
Dim AuthenticationTicket As
String
AuthenticationTicket = ""
Set objHTTP = CreateObject("Msxml2.ServerXMLHTTP")
strPost = "https://technet.rapaport.com/HTTP/Authenticate.aspx"
objHTTP.Open "POST", strPost,
False
Call objHTTP.setRequestHeader("Content-Type",
"application/x-www-form-urlencoded")
objHTTP.send ("Username=USERNAME&Password=PASSWORD")
replyTXT = objHTTP.responseText
If objHTTP.Status = "200"
Then 'success
AuthenticationTicket = replyTXT
Else
AuthenticationTicket = ""
End If
Dim PriceSheetURL As String
Dim PriceSheetCSV As String
Dim iFileNumber As Integer
PriceSheetURL = "http://technet.rapaport.com/HTTP/Prices/CSV2_Round.aspx"
PriceSheetURL = PriceSheetURL & "?ticket=" & AuthenticationTicket
objHTTP.Open "GET", PriceSheetURL,
False
objHTTP.send
If objHTTP.Status = "200"
Then
PriceSheetCSV = objHTTP.responseText
iFileNumber = FreeFile
Open "C:\Temp\Rounds.csv"
For Output As #iFileNumber
Print #iFileNumber, PriceSheetCSV
Close #iFileNumber
End If
PriceSheetURL = "http://technet.rapaport.com/HTTP/Prices/CSV2_Pear.aspx"
PriceSheetURL = PriceSheetURL & "?ticket=" & AuthenticationTicket
objHTTP.Open "GET", PriceSheetURL,
False
objHTTP.send
If objHTTP.Status = "200"
Then
PriceSheetCSV = objHTTP.responseText
iFileNumber = FreeFile
Open "C:\Temp\Pear.csv"
For Output As #iFileNumber
Print #iFileNumber, PriceSheetCSV
Close #iFileNumber
End If
|