How to copy web image daily

  • Thread starter Thread starter Guest
  • Start date Start date
Eve said:
Anyone knows how to copy a web image (weather image), daily from internet
into a local folder??

I tried this:
C:\>xcopy
"http://image.espanol.weather.com/web/maps/es_ES/weather/forecast/spain_outlook_day1_277_sp.jpg"
c:\
0 files copied

Thanks in advance!!

You need to use VBscript or a program to do this. Replace "c:\" with the
path indicating where you want your images saved.

Source Michael Harris & Alex K. Angelopoulos
http://www.google.com/[email protected]

-------------- save lines below in a file with .vbs
extension -----------------------

ImgName = "spain_outlook_day1_277_sp.jpg"

SaveName = "c:\" & ImgName
Url = "http://image.espanol.weather.com/web/maps/es_ES/weather/forecast/" &
_
ImgName

DownBinFile SaveName, Url

Wscript.Echo "Download of", SaveName, " is complete."

Sub DownBinFile(FilePath, sURL)
const adTypeBinary = 1
const adModeReadWrite = 3
const adSaveCreateOverwrite = 2
' Create an xmlhttp object:
set oXML = CreateObject("Microsoft.XMLHTTP")
oXML.open "GET", sURL, False
oXML.send

With CreateObject("ADODB.Stream")
.type = adTypeBinary
.mode = adModeReadWrite
.open
On Error Resume Next
Do
Wscript.Sleep 250
.write oXML.responseBody
Loop Until Err = 0
.savetofile FilePath, adSaveCreateOverwrite
End With
End Sub
 
Right click on the image.
A menu will open.
Click on Save Picture As.
A window will open for you to select the folder you want to save the picture
in.
Before you do this, make a new folder, name it Weather and then save your
daily image in this folder.
 
Thank you LJB, this script works fine!!

LJB said:
You need to use VBscript or a program to do this. Replace "c:\" with the
path indicating where you want your images saved.

Source Michael Harris & Alex K. Angelopoulos
http://www.google.com/[email protected]

-------------- save lines below in a file with .vbs
extension -----------------------

ImgName = "spain_outlook_day1_277_sp.jpg"

SaveName = "c:\" & ImgName
Url = "http://image.espanol.weather.com/web/maps/es_ES/weather/forecast/" &
_
ImgName

DownBinFile SaveName, Url

Wscript.Echo "Download of", SaveName, " is complete."

Sub DownBinFile(FilePath, sURL)
const adTypeBinary = 1
const adModeReadWrite = 3
const adSaveCreateOverwrite = 2
' Create an xmlhttp object:
set oXML = CreateObject("Microsoft.XMLHTTP")
oXML.open "GET", sURL, False
oXML.send

With CreateObject("ADODB.Stream")
.type = adTypeBinary
.mode = adModeReadWrite
.open
On Error Resume Next
Do
Wscript.Sleep 250
.write oXML.responseBody
Loop Until Err = 0
.savetofile FilePath, adSaveCreateOverwrite
End With
End Sub
 
With a little additional scripting work you might be able to
programmatically construct the image name. Then you could schedule this
scrip on your PC to run daily unattended.

LJB
 
Click Control - Print Scrn - Open clipboard - File - Open in any viewer
program - Make any alterations -Save As
 
Back
Top