Solved

Automated Get and save

Posted on 2013-02-01
5
339 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Well hello again!  Glad to see you've made it this far without giving up.  In this, the fourth installment of my popular series, I'm going to cover functions and subroutines, what they are, and why they are useful.  Just in case you stumbled onto th…
This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

914 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

16 Experts available now in Live!

Get 1:1 Help Now