Last active
August 29, 2015 14:05
-
-
Save J2CJobs/1cece3393e4a29a799a4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' 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