Skip to content

Instantly share code, notes, and snippets.

@J2CJobs
Last active August 29, 2015 14:05
Show Gist options
  • Save J2CJobs/1cece3393e4a29a799a4 to your computer and use it in GitHub Desktop.
Save J2CJobs/1cece3393e4a29a799a4 to your computer and use it in GitHub Desktop.
' Set your settings
strHDLocation = "c:\test.xml"
strFileURL = "http://www2.jobs2careers.com/feed.php?id=[id]&pass=[pass]"
' Fetch the file
Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP")
objXMLHTTP.open "GET", strFileURL, false
objXMLHTTP.send()
If objXMLHTTP.Status = 200 Then
Set objADOStream = CreateObject("ADODB.Stream")
objADOStream.Open
objADOStream.Type = 1 'adTypeBinary
objADOStream.Write objXMLHTTP.ResponseBody
objADOStream.Position = 0 'Set the stream position to the start
Set objFSO = Createobject("Scripting.FileSystemObject")
If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocation
Set objFSO = Nothing
objADOStream.SaveToFile strHDLocation
objADOStream.Close
Set objADOStream = Nothing
End if
Set objXMLHTTP = Nothing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment