[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Automated Get and save

Posted on 2013-02-01
5
Medium Priority
?
352 Views
Last Modified: 2013-02-01
I need to download the .csv file from this link every 20 minutes:
http://aviationweather.gov/adds/dataserver_current/httpparam?dataSource=metars&requestType=retrieve&format=csv&stationString=KFWA&hoursBeforeNow=1

It tries to name itself "httpparam" and I change that to weather.txt

I use the data in various ways.

Rather than going to the site and clicking "save" each hour, is there a way to automatically poll and downlod the file without input?

I cannot use any other software than I have, but CAN run VBScripts!
0
Comment
Question by:TIgerV
  • 3
  • 2
5 Comments
 
LVL 22

Expert Comment

by:plusone3055
ID: 38844520
instructions are on this link for hte script
http://orangescripts.blogspot.com/2007/09/vbscript-to-retrieve-file-from-url-and.html

Then put the script in windows sheduled tasks to run every 20 min
BOOM your done :)
0
 

Author Comment

by:TIgerV
ID: 38844663
Activex can't create object: 'MSXML2.SERVERObj1'

Any ideas how I can get beyond that?  It's coming from line 4
0
 
LVL 22

Accepted Solution

by:
plusone3055 earned 2000 total points
ID: 38844710
use this name the file 123.vbs

dim xHttp: Set xHttp = createobject("Microsoft.XMLHTTP")
dim bStrm: Set bStrm = createobject("Adodb.Stream")
xHttp.Open "GET", "http://aviationweather.gov/adds/dataserver_current/httpparam?dataSource=metars&requestType=retrieve&format=csv&stationString=KFWA&hoursBeforeNow=1", False
xHttp.Send

with bStrm
    .type = 1 '//binary
    .open
    .write xHttp.responseBody
    .savetofile "C:\TEST\123.txt", 2 '//overwrite
end with
0
 

Author Closing Comment

by:TIgerV
ID: 38844734
PERFECT!  Much appreciated.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello again, all.  For those of you that have been following along, you'll know that this is my third article on this topic (though it is not Part III).  This article is sort of remedial, and probably the topic with which I should have started the s…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question