Solved

Automated Get and save

Posted on 2013-02-01
5
348 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
 

Author Closing Comment

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

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Introduction During my participation as a VBScript contributor at Experts Exchange, one of the most common questions I come across is this: "I have a script that runs against only one computer. How can I make it run against a list of computers in …
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

729 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