Solved

Automated Get and save

Posted on 2013-02-01
5
338 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 500 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
 
LVL 22

Expert Comment

by:plusone3055
ID: 38844713
0
 

Author Closing Comment

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

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Welcome to part one of a multi-part tutorial series, VBScript for Windows System Administrators.  The goal of this series is to teach non-programmers how to write useful VBS code to automate their environment, and perform tasks faster, and in a more…
When it comes to writing scripts for a Client/Server computing environment it is essential to consider some way of enabling the authentication functionality within a script. This sort of consideration mainly comes into the picture when we are dealin…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

758 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now