かなり前に作った物なのでおかしい所があるかもしれません。
もしよかったら参考にしてください。
#module HSPhtml
#uselib "hspsock.dll"
#func sockopen sockopen 4
#func sockclose sockclose 0
#func sockget sockget 1
#func sockgetc sockgetc 1
#func sockput sockput 6
#func sockputc sockputc 2
#func sockmake sockmake $10
#func sockgetb sockgetb 1
#func sockputb sockputb 1
#func ipget ipget $10
#func sockcheck sockcheck 0
#func sockwait sockwait $10
#func sockbye sockbye $100
;----------------------------------------------------------------------
#defcfunc gethtml str p1 , int p2
*modoru
sdim buf,1024*1024
sdim buf2,1024*1024
url=p1
TimeOut=p2
if フラグ=0:sdim buf,1024*1024:sdim buf2,1024*1024
フラグ=1
seek = instr(url,0,"http://")
seek = 7
getstr host,url,seek,'/'
seek = seek+strsize-1
rdir = strmid(url,seek,1024)
size = strlen(rdir)
sockopen 0,host,80
if stat!0 : sockclose 0 :await 1000: goto*modoru
sockput "GET http://"+host+rdir+" HTTP/1.0\nHost: "+host+"\nUser-Agent: HSP PaoProject\n\n",0
;HEAD GET
if stat!0 : sockclose 0 :await 1000: goto*modoru
;----------------------------------------------------------------------
repeat TimeOut
sockcheck 0
st=stat
if st=0 {
sockgetb buf2,0,1024*1024,0
size = stat
if size=0 :ct=cnt: break
buf = buf+strmid(buf2,0,size)
//continue 0
}else{
if st=2 {break}
}
title ""+cnt
await 1
loop
sockclose 0
stat値=0
if st {
if st=1 {stat値=-1}
if st=2 {stat値=-2}
}
sockclose 0
if stat値=0:mref ct2,64:ct2=ct
if stat値!0:mref ct2,64:ct2=stat値
return buf
#global
mes gethtml("http://hsp.tv/play/pforum.php?mode=all&num=76867",1000);p1にurl、p2にタイムアウトまでの時間