Technology Dribble

Another WordPress weblog about Technology

Archive for September, 2008

FREE Website Thumbnails

Web BacklinksWant to show web thumbnail preview in your site dynamically? Then Web Backlinks Website Thumbnail Service may be able to help you.

Web Backlinks Website Thumbnail Service is a FREE service for website owners who want to show website thumbnail previews on their website. If a website thumbnail is accessed but does not exist on our servers then the request is automatically queued for processing and is made available within 24 hours. Dynamically generate website thumbnails in your site NOW, no sign up necessary.

Visit http://webthumb.web-backlinks.com/ for more details.

posted by admin in dynamic web thumbnails and have No Comments

URL2File

I ran into a problem recently with my windows batch script files because I use this great utility called URL2FILE.exe which is a free 32bit Windows console-mode application able to retrieve and save the content of a World Wide Web content to a local file. Well, for some unknown reason our company virus scan software, VirusScan, decided that URL2FILE.exe was a Generic PUP.z virus and cascade deleted all copies of the file on our server! In an instant all my services that use the file was rendered useless!

Virus Console

With limited knowledge of Windows Script Hosting and VbScript, I’ve managed to write up a small vbscript file that pretty much does what url2file aims to do with text files (please note that the script does NOT work with binary files). To effectively create a script that replicates the download of web pages similar to what url2file.exe does, then do the following:

Download and install Windows script hosting from:

http://www.microsoft.com/downloads/details.aspx?FamilyID=47809025-D896-482E-A0D6-524E7E844D81&displaylang=en

Save the following code as URL2FILE.vbs:

'Arguments
'Wscript.Arguments(0) - Website  URL
'Wscript.Arguments(1) - Full File Path
Dim lngResolveTimeout, lngConnectTimeout, lngSendTimeout, lngReceiveTimeout, retVal
'30 Min timeout when accessing web page
lngResolveTimeout = 1800000
lngConnectTimeout = 1800000
lngSendTimeout = 1800000
lngReceiveTimeout = 1800000
'Valid URL continue validation
Dim xml, txresponse
Set xml = CreateObject("MSXML2.ServerXMLHTTP")
xml.setTimeouts lngResolveTimeout, lngConnectTimeout, lngSendTimeout, lngReceiveTimeout
xml.Open "GET", Wscript.Arguments(0), False
xml.Send
'Write response to file
Dim oFs, oTextFile, iMode
iMode = 2
set oFs = createobject("Scripting.FileSystemObject")
set oTextFile = oFs.OpenTextFile(Wscript.Arguments(1), iMode, True)
oTextFile.Write xml.responseText
oTextFile.Close
set oTextFile = nothing
set oFS = nothing

To run the script in a command prompt session:

url2file.vbs [URL] [FULL OUTPUT FILE PATH]
eg. url2file.vbs http://localhost/test.htm c:\temp\test.htm

posted by admin in Useful Scripts,vbscript and have No Comments