I was building a database from a static site and wrote a script to pull the content and images from the old site and store it on my computer. I thought someone might find it useful.
I put in a tame sample that just grabs all the pics from a Cameron Diaz page, but you can easily modify it to do something like download all the full sized daily pictures from the Hun onto your computer with one click (ask me if you want the setting for that:wink

or grab the text and images from a weather or news site to display on yours.
Enjoy - Cat
- Code: Select all
<!--METADATA TYPE="typelib"
UUID="00000205-0000-0010-8000-00AA006D2EA4"
NAME="ADODB Type Library"
-->
<%
server.scripttimeout = 6000
saveto = "C:\savedpics\" ' folder to save the pictures to (needs write permissions)
url = "http://www.virtuous.co.uk/fantasy/gallery/diaz.htm" ' url to the page you want to parse
Set xml = Server.CreateObject("Msxml2.ServerXMLHTTP")
xml.Open "GET", url, False
xml.Send
s = xml.responseText
set regmp= new RegExp
regmp.IgnoreCase = True
regmp.global = true
regmp.pattern = "[img][/img]500 then
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Type = adTypeBinary
objStream.Open
objStream.Write data
objStream.SaveToFile saveto & ipid & ".jpg", 2
objStream.Close
Set objStream = Nothing
end if
Set objHTTP = Nothing
end sub
%>