Created
December 15, 2010 07:11
-
-
Save csanz/741721 to your computer and use it in GitHub Desktop.
cool file downloader... talk about REST 0.1 ahha
This file contains hidden or 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
| Call Ask() | |
| Sub Ask() | |
| Dim intDoIt | |
| Dim WSHShell | |
| Set WSHShell = WScript.CreateObject("WScript.Shell") | |
| strPage = InputBox("Enter Domain you wish to Grab","GRAB TOOL 1.2 - by Chris Sanz", "http://") | |
| strPage = strPage | |
| if strPage = "" then | |
| Dim MyVar | |
| MyVar = MsgBox ("Are sure you want to Quit",68, "GRAB TOOL 1.2") | |
| if MyVar = 7 then | |
| call Ask() | |
| end if | |
| Else | |
| On Error Resume Next | |
| Set objXMLHttp = CreateObject ("Microsoft.XMLHTTP") | |
| objXMLHttp.Open "GET", strPage ,False,"","" | |
| objXMLHttp.Send | |
| If Err.Number = 0 Then | |
| MsgBox "Requesting File",64,"GRAB TOOL 1.2" | |
| If objXMLHttp.Status = 200 then | |
| Dim fso, MyFile | |
| path = "grabbed.txt" | |
| Set fso = CreateObject("Scripting.FileSystemObject") | |
| Set MyFile = fso.CreateTextFile(path, True) | |
| MyFile.WriteLine(objXMLHttp.ResponseText) | |
| MyFile.Close | |
| MsgBox "File was Created under grabbed.txt",64,"GRAB TOOL 1.2" | |
| Else | |
| MsgBox "incorrect URL " | |
| End if | |
| Else | |
| errorDes = Err.Description | |
| MsgBox errorDes , 16,"GRAB TOOL 1.2" | |
| MsgBox "Make sure you put a Valid URL",64,"GRAB TOOL 1.2" | |
| Call Ask() | |
| End If | |
| Set objXMLHttp = Nothing | |
| end if | |
| End Sub | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment