PureBytes Links
Trading Reference Links
|
hello,
--- In amibroker@xxxxxxxxxxxxxxx, "dingo" <waledingo@xxxx> wrote:
> Thanks! I'll play with it. Got any other "gems"?
ok.. sometimes data are in binary format.. below is an example in VBS that will download a picture "dual_xeon_011.jpg". *sDestFolder* variable points to C:\ so expect the picture there. it takes some time to complete the task -- be patient.
this script may give you a flavor how to manipulate other types of binary data.
for me the most valuable source of information on scripting was microsoft's scripting usenet groups and the documentation on their website.
cheers,
BM
'Requires:
'
' - XML 3.0 for "msxml2.ServerXMLHTTP"
' - ADO 2.5+ for "adodb.stream"
'
sSrcUrl = "http://www.2cpu.com/albums/iwill_dpi533/"
sDestFolder = "C:\"
sImageFile = "dual_xeon_011.jpg"
sContentTypeExpected = "image/jpeg"
set oHTTP = CreateObject("msxml2.ServerXMLHTTP")
oHTTP.open "GET", sSrcUrl & sImageFile, False
oHTTP.send
if oHTTP.status <> 200 then
msgbox "unexpected status = " & oHTTP.status & vbcrlf & oHTTP.statusText
wscript.quit
end if
sContentTypeReturned = oHTTP.getResponseHeader("content-type")
if sContentTypeReturned <> sContentTypeExpected then
msgbox "unexpected content-type = " & sContentTypeReturned & vbcrlf & "expected = " & sContentTypeExpected
wscript.quit
end if
set oStream = createobject("adodb.stream")
Const adTypeBinary = 1
Const adSaveCreateOverWrite = 2
oStream.type = adTypeBinary
oStream.open
oStream.write oHTTP.responseBody
oStream.savetofile sDestFolder & sImageFile, adSaveCreateOverWrite
set oStream = nothing
set oHTTP = nothing
msgbox "Done..."
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
---------------------------------------------------------------------~->
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|