用于提取网易文件的hta代码
程序员文章站
2022-08-26 10:02:50
<title>网易文件摄取</title>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<hta:application
id="myhyliapp"
applicationname="设置程序"
version="1.0"
scroll="no"
innerborder="no"
contextmenu="no"
caption="yes"
showintaskbar="yes"
singleinstance="yes"
sysmenu="yes"
windowstate="normal"
navigable="yes"
/>
<style type="text/css">
<!--
.tt1 { font-family: "隶书";
font-size: 24px;
font-weight: bold;
}
.title {
}
.info {
font-family: "隶书";
font-size: 16px;
color: #ff0000;
font-weight: bold;
}
.separator { width:100%;
margin:2px;
margin-top:-4px;
height:12px;
overflow:hidden;
}
.list { height: 80px;
width: 100%;
background-color: #e3eff9;
}
.s_button {
background-color: #ffcc99;
position: static;
text-align: center;
vertical-align: middle;
padding: 1px;
color: #0033cc;
border: 1px solid #996633;
width: 100%;
}
.grid1 {
font-family: "隶书";
font-size: 16px;
background-color: #006699;
background-position: center center;
text-align: center;
vertical-align: middle;
height: 100%;
width: 100%;
color: #00ff99;
}
.grid2 {
font-family: "宋体";
text-align: left;
vertical-align: middle;
height: 100%;
width: 100%;
font-size: 12px;
}
.grid3 {
text-align: center;
vertical-align: middle;
height: 100%;
width: 100%;
}
.preview {
position:absolute;
width:140px;
height:140px;
z-index:1;
left: 301px;
top: 61px;
overflow: visible;
border-top-color: #ff0000;
border-right-color: #ff0000;
border-bottom-color: #ff0000;
border-left-color: #ff0000;
background-color: #ff9966;
margin: 1px;
padding: 1px;
visibility: hidden;
}
.style2 {
color: #00ff00;
font-weight: bold;
font-family: "隶书";
font-size: 14px;
}
-->
</style>
<div class="separator">
<hr>
</div>
<table width="100%" height="4%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2" align="center" valign="middle" id=menubar onselectstart="return false"><span class="tt1" id="consume">网易图片文件一览表</span> </td>
</tr>
</table>
<div class="separator">
<hr>
</div>
<table width="100%" height="415" border="1">
<tr>
<td width="81%" height="16" rowspan="8" valign="top" bgcolor="#ffffff" style="border-style: solid; border-color: #000080"><div class="info" id=list style="width:100%;height:405; overflow-y: auto; border: solid 1 gray;"></div></td>
<td height="16" colspan="2" align="center" valign="middle" bordercolor="#ff0000" bgcolor="#000080" style="border-style: solid; border-color: #000080"><div class="preview" id="preview">
<p> </p>
</div>
<span class="style2"> 信息公布</span></td>
</tr>
<tr>
<td height="182" colspan="2" align="left" valign="top" bgcolor="#ffffff" class="info" style="border-style: solid; border-color: #000080"><div class="info" id="infotext" style="width:100%;height:177; overflow-y: auto">
<p>本程序可以*下载网易图片..</p>
<p> </p>
</div></td>
</tr>
<tr>
<td height="33" colspan="2" align="center" valign="middle" bgcolor="#ffffff" class="info" style="border-style: solid; border-color: #000080"><input name="add" type="submit" class="s_button" id="add" onclick="show()" value="取文件信息" /></td>
</tr>
<tr>
<td height="33" align="center" valign="middle" bgcolor="#ffffff" style="border-style: solid; border-color: #000080"><select name="atype" id="atype" onchange="changevalue()">
<option value="jpg">彩图</option>
<option value="gif">动画</option>
</select></td>
<td height="33" align="center" valign="middle" bgcolor="#ffffff" style="border-style: solid; border-color: #000080"><select name="imagetype" id="imagetype">
<option selected="selected">图片类型</option>
<option>全部</option>
<option value="90">绝色风光</option>
<option value="91">四季花语 </option>
<option value="89">海底世界 </option>
<option value="34">绝色美女 </option>
<option value="198">都市丽人</option>
<option value="200">手绘美女</option>
</select></td>
</tr>
<tr>
<td height="33" colspan="2" align="center" valign="middle" bgcolor="#ffffff" style="border-style: solid; border-color: #000080"><input name="del2" type="submit" class="s_button" id="del2" onclick="downloadfile()" value="下载选定项" /></td>
</tr>
<tr>
<td height="33" colspan="2" align="center" valign="middle" bgcolor="#ffffff" style="border-style: solid; border-color: #000080"><input name="del" type="submit" class="s_button" id="del" onclick="tb_del()" value="删除选定项" /></td>
</tr>
<tr>
<td width="5%" height="25" align="center" valign="middle" bgcolor="#000080" class="style2" style="border-style: solid; border-color: #000080">从 </td>
<td width="14%" bgcolor="#ffffff" valign="middle" align="center" style="border-style: solid; border-color: #000080"><a title="在此处输入起始页数">
<input name="start1" type="text" id="start1" value="1" size="10" />
</a></td>
</tr>
<tr>
<td height="26" align="center" valign="middle" bgcolor="#000080" class="style2" style="border-style: solid; border-color: #000080">到</td>
<td height="26" align="center" valign="middle" bgcolor="#ffffff" style="border-style: solid; border-color: #000080"><a title="在此处输入结束页数">
<input name="start2" type="text" id="start2" size="10" value="1"/>
</a></td>
</tr>
</table>
<script language="vbscript">
public fileext
str1 = "<tr><td><span class='grid1'><input type=checkbox id='sall' onclick='selectall()'>全都选</span></td>"
str1 = str1& "<td><span class='grid1'>预览</span></td>"
str1 = str1 & "<td><span class='grid1'>文件路径</span></td>"
str1 = str1 & "<td><span class='grid1'>文件名称</span></td></tr>"
sub window_onload
window.resizeto 750, 515
ileft = (window.screen.width -750) / 2
itop = (window.screen.height -515) / 2
window.moveto ileft, itop
end sub
function connect(num)
dim imageinfo, length
fileext = atype.options(atype.selectedindex).value
imgtype = imagetype.options(imagetype.selectedindex).value
imgtypenum = atype.selectedindex
url = "http://mms.163.com/new_web/cm_lv2_pic.jsp?catid="&imgtype&"&ord=ddate&page="&num&"&type="&imgtypenum&"&key="
imageurl = "http://mmsimg.163.com/new_web/loaditem.jsp/type="&imgtypenum&"/path="
set http = createobject("microsoft.xmlhttp")
http.open "get", url, false
http.send
vin = http.responsebody
strreturn = ""
for i = 1 to lenb(vin)
thischarcode = ascb(midb(vin, i, 1))
if thischarcode < &h80 then
strreturn = strreturn & chr(thischarcode)
else
nextcharcode = ascb(midb(vin, i + 1, 1))
strreturn = strreturn & chr(clng(thischarcode) * &h100 + cint (nextcharcode))
i = i + 1
end if
next
'------获取文件的地址------------'
do
pos = instr(strreturn, "showpic")
pos1 = instr(strreturn, "128x128")
if pos>0 then
length = pos1 - pos
imageinfo = mid(strreturn, pos, length)
images = split(imageinfo, ",")
imagepath = mid(images(2), 2, len(images(2)) -1)&"128x128."& fileext
'----------获取文件的名字------------'
namepos = instr(strreturn, "\n名字:")
namepos1 = instr(strreturn, "\n人气")
namelength = namepos1 - namepos
imagename = mid(mid(strreturn, namepos, namelength), 6)
strhtml = strhtml & "<tr><td><span class='grid2'><input id=addme type=checkbox>选定</span></td>"
strhtml = strhtml &"<td><span class='grid3'><a onmousemove='view()' onmouseout='hideview()' href=#><img onclick='addpro()' src='"&imageurl&imagepath&"' width=30 height=20></a></span></td>"
strhtml = strhtml & "<td><span class='grid2'>" & imagepath & "</span></td>"
strhtml = strhtml & "<td><span class='grid2'>" & imagename & "</span></td></tr>"
strreturn = mid(strreturn, namepos1 + 20)
else
exit do
end if
loop
connect = strhtml
end function
function writeinner()
for i = start1.value to start2.value
strhtml = strhtml & connect(i)
next
strhtml = "<table id='mytable' width=100% border=1 bordercolor=green>" &str1&strhtml& "</table>"
list.innerhtml = strhtml
infotext.innertext = infotext.innertext & "连接成功。"
infotext.innertext = infotext.innertext & vbcrlf &vbcrlf & "从第" & start1.value & "页到第" & start2.value & "页的gif图片文件信息!"
end function
function show()
if not (isnumeric(start2.value)) or not (isnumeric(start2.value)) then
infotext.innertext = infotext.innertext & vbcrlf & "配置错误..."
else
infotext.innertext = "正在连接..."
window.settimeout "writeinner()", 200
end if
end function
sub view()
strhtml1 = "<img src='" &window.event.srcelement.src &"' width='140' height='140'>"
preview.runtimestyle.pixelleft = window.event.x + 5
preview.runtimestyle.pixeltop = window.event.y + 5
preview.style.visibility = "visible"
preview.innerhtml = strhtml1
end sub
sub hideview()
preview.style.visibility = "hidden"
end sub
sub addpro()
set obj = window.event.srcelement.parentelement.parentelement.parentelement.parentelement
if obj.cells(0).children(0).children(0).checked = false then
obj.cells(0).children(0).children(0).checked = true
else
obj.cells(0).children(0).children(0).checked = false
end if
end sub
sub tb_del()
set obj = document.all.nameditem("mytable")
if obj.rows.length>2 then
set tagid = document.all.nameditem("addme") '获取对象id:delcheck'
for each otag in tagid
if otag.checked then
objrow = otag.parentelement.parentelement.parentelement.rowindex '获取对象的行序数;'
obj.deleterow(objrow) '删除该项;'
end if
next
else
msgbox "才一项你都删,哪有这样的?!", 0, "删除提醒"
exit sub
end if
end sub
sub selectall()
set obj = document.all.nameditem("mytable")
set objcheck = document.all.nameditem("sall")
set tagid = document.all.nameditem("addme") '获取对象id:addme'
for each otag in tagid
otag.checked = objcheck.checked
next
end sub
sub download()
set fso = createobject("scripting.filesystemobject")
if not (fso.folderexists("★网易下载图片★")) then
fso.createfolder("★网易下载图片★")
end if
set http = createobject("microsoft.xmlhttp")
set obj = document.all.nameditem("mytable")
set tagid = document.all.nameditem("addme") '获取对象id:delcheck'
for each otag in tagid
if otag.checked then
set objrow = otag.parentelement.parentelement.parentelement '获取对象的行;'
downurl = objrow.cells(1).children(0).children(0).children(0).src
filename = objrow.cells(3).children(0).innertext
http.open "get", downurl, false
http.send
set aso = createobject("adodb.stream")
aso.type = 1
aso.open
aso.write http.responsebody
aso.savetofile "★网易下载图片★\" & filename & "."&fileext, 2
aso.close
end if
next
infotext.innertext = infotext.innertext & vbcrlf & "文件下载成功。"
infotext.innertext = infotext.innertext & vbcrlf & "文件保存在:" & vbcrlf &"“★网易下载图片★”下"
end sub
sub downloadfile()
infotext.innertext = "正在下载文件...." '"
window.settimeout "download()", 200
end sub
sub changevalue()
aid = array("130", "112", "67", "14", "122", "158")
pid = array("90", "91", "89", "34", "198", "200")
if atype.selectedindex = 0 then
for i = 0 to 5
imagetype.options(i + 2).value = pid(i)
next
else
for i = 0 to 5
imagetype.options(i + 2).value = aid(i)
next
end if
end sub
</script>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<hta:application
id="myhyliapp"
applicationname="设置程序"
version="1.0"
scroll="no"
innerborder="no"
contextmenu="no"
caption="yes"
showintaskbar="yes"
singleinstance="yes"
sysmenu="yes"
windowstate="normal"
navigable="yes"
/>
<style type="text/css">
<!--
.tt1 { font-family: "隶书";
font-size: 24px;
font-weight: bold;
}
.title {
}
.info {
font-family: "隶书";
font-size: 16px;
color: #ff0000;
font-weight: bold;
}
.separator { width:100%;
margin:2px;
margin-top:-4px;
height:12px;
overflow:hidden;
}
.list { height: 80px;
width: 100%;
background-color: #e3eff9;
}
.s_button {
background-color: #ffcc99;
position: static;
text-align: center;
vertical-align: middle;
padding: 1px;
color: #0033cc;
border: 1px solid #996633;
width: 100%;
}
.grid1 {
font-family: "隶书";
font-size: 16px;
background-color: #006699;
background-position: center center;
text-align: center;
vertical-align: middle;
height: 100%;
width: 100%;
color: #00ff99;
}
.grid2 {
font-family: "宋体";
text-align: left;
vertical-align: middle;
height: 100%;
width: 100%;
font-size: 12px;
}
.grid3 {
text-align: center;
vertical-align: middle;
height: 100%;
width: 100%;
}
.preview {
position:absolute;
width:140px;
height:140px;
z-index:1;
left: 301px;
top: 61px;
overflow: visible;
border-top-color: #ff0000;
border-right-color: #ff0000;
border-bottom-color: #ff0000;
border-left-color: #ff0000;
background-color: #ff9966;
margin: 1px;
padding: 1px;
visibility: hidden;
}
.style2 {
color: #00ff00;
font-weight: bold;
font-family: "隶书";
font-size: 14px;
}
-->
</style>
<div class="separator">
<hr>
</div>
<table width="100%" height="4%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2" align="center" valign="middle" id=menubar onselectstart="return false"><span class="tt1" id="consume">网易图片文件一览表</span> </td>
</tr>
</table>
<div class="separator">
<hr>
</div>
<table width="100%" height="415" border="1">
<tr>
<td width="81%" height="16" rowspan="8" valign="top" bgcolor="#ffffff" style="border-style: solid; border-color: #000080"><div class="info" id=list style="width:100%;height:405; overflow-y: auto; border: solid 1 gray;"></div></td>
<td height="16" colspan="2" align="center" valign="middle" bordercolor="#ff0000" bgcolor="#000080" style="border-style: solid; border-color: #000080"><div class="preview" id="preview">
<p> </p>
</div>
<span class="style2"> 信息公布</span></td>
</tr>
<tr>
<td height="182" colspan="2" align="left" valign="top" bgcolor="#ffffff" class="info" style="border-style: solid; border-color: #000080"><div class="info" id="infotext" style="width:100%;height:177; overflow-y: auto">
<p>本程序可以*下载网易图片..</p>
<p> </p>
</div></td>
</tr>
<tr>
<td height="33" colspan="2" align="center" valign="middle" bgcolor="#ffffff" class="info" style="border-style: solid; border-color: #000080"><input name="add" type="submit" class="s_button" id="add" onclick="show()" value="取文件信息" /></td>
</tr>
<tr>
<td height="33" align="center" valign="middle" bgcolor="#ffffff" style="border-style: solid; border-color: #000080"><select name="atype" id="atype" onchange="changevalue()">
<option value="jpg">彩图</option>
<option value="gif">动画</option>
</select></td>
<td height="33" align="center" valign="middle" bgcolor="#ffffff" style="border-style: solid; border-color: #000080"><select name="imagetype" id="imagetype">
<option selected="selected">图片类型</option>
<option>全部</option>
<option value="90">绝色风光</option>
<option value="91">四季花语 </option>
<option value="89">海底世界 </option>
<option value="34">绝色美女 </option>
<option value="198">都市丽人</option>
<option value="200">手绘美女</option>
</select></td>
</tr>
<tr>
<td height="33" colspan="2" align="center" valign="middle" bgcolor="#ffffff" style="border-style: solid; border-color: #000080"><input name="del2" type="submit" class="s_button" id="del2" onclick="downloadfile()" value="下载选定项" /></td>
</tr>
<tr>
<td height="33" colspan="2" align="center" valign="middle" bgcolor="#ffffff" style="border-style: solid; border-color: #000080"><input name="del" type="submit" class="s_button" id="del" onclick="tb_del()" value="删除选定项" /></td>
</tr>
<tr>
<td width="5%" height="25" align="center" valign="middle" bgcolor="#000080" class="style2" style="border-style: solid; border-color: #000080">从 </td>
<td width="14%" bgcolor="#ffffff" valign="middle" align="center" style="border-style: solid; border-color: #000080"><a title="在此处输入起始页数">
<input name="start1" type="text" id="start1" value="1" size="10" />
</a></td>
</tr>
<tr>
<td height="26" align="center" valign="middle" bgcolor="#000080" class="style2" style="border-style: solid; border-color: #000080">到</td>
<td height="26" align="center" valign="middle" bgcolor="#ffffff" style="border-style: solid; border-color: #000080"><a title="在此处输入结束页数">
<input name="start2" type="text" id="start2" size="10" value="1"/>
</a></td>
</tr>
</table>
<script language="vbscript">
public fileext
str1 = "<tr><td><span class='grid1'><input type=checkbox id='sall' onclick='selectall()'>全都选</span></td>"
str1 = str1& "<td><span class='grid1'>预览</span></td>"
str1 = str1 & "<td><span class='grid1'>文件路径</span></td>"
str1 = str1 & "<td><span class='grid1'>文件名称</span></td></tr>"
sub window_onload
window.resizeto 750, 515
ileft = (window.screen.width -750) / 2
itop = (window.screen.height -515) / 2
window.moveto ileft, itop
end sub
function connect(num)
dim imageinfo, length
fileext = atype.options(atype.selectedindex).value
imgtype = imagetype.options(imagetype.selectedindex).value
imgtypenum = atype.selectedindex
url = "http://mms.163.com/new_web/cm_lv2_pic.jsp?catid="&imgtype&"&ord=ddate&page="&num&"&type="&imgtypenum&"&key="
imageurl = "http://mmsimg.163.com/new_web/loaditem.jsp/type="&imgtypenum&"/path="
set http = createobject("microsoft.xmlhttp")
http.open "get", url, false
http.send
vin = http.responsebody
strreturn = ""
for i = 1 to lenb(vin)
thischarcode = ascb(midb(vin, i, 1))
if thischarcode < &h80 then
strreturn = strreturn & chr(thischarcode)
else
nextcharcode = ascb(midb(vin, i + 1, 1))
strreturn = strreturn & chr(clng(thischarcode) * &h100 + cint (nextcharcode))
i = i + 1
end if
next
'------获取文件的地址------------'
do
pos = instr(strreturn, "showpic")
pos1 = instr(strreturn, "128x128")
if pos>0 then
length = pos1 - pos
imageinfo = mid(strreturn, pos, length)
images = split(imageinfo, ",")
imagepath = mid(images(2), 2, len(images(2)) -1)&"128x128."& fileext
'----------获取文件的名字------------'
namepos = instr(strreturn, "\n名字:")
namepos1 = instr(strreturn, "\n人气")
namelength = namepos1 - namepos
imagename = mid(mid(strreturn, namepos, namelength), 6)
strhtml = strhtml & "<tr><td><span class='grid2'><input id=addme type=checkbox>选定</span></td>"
strhtml = strhtml &"<td><span class='grid3'><a onmousemove='view()' onmouseout='hideview()' href=#><img onclick='addpro()' src='"&imageurl&imagepath&"' width=30 height=20></a></span></td>"
strhtml = strhtml & "<td><span class='grid2'>" & imagepath & "</span></td>"
strhtml = strhtml & "<td><span class='grid2'>" & imagename & "</span></td></tr>"
strreturn = mid(strreturn, namepos1 + 20)
else
exit do
end if
loop
connect = strhtml
end function
function writeinner()
for i = start1.value to start2.value
strhtml = strhtml & connect(i)
next
strhtml = "<table id='mytable' width=100% border=1 bordercolor=green>" &str1&strhtml& "</table>"
list.innerhtml = strhtml
infotext.innertext = infotext.innertext & "连接成功。"
infotext.innertext = infotext.innertext & vbcrlf &vbcrlf & "从第" & start1.value & "页到第" & start2.value & "页的gif图片文件信息!"
end function
function show()
if not (isnumeric(start2.value)) or not (isnumeric(start2.value)) then
infotext.innertext = infotext.innertext & vbcrlf & "配置错误..."
else
infotext.innertext = "正在连接..."
window.settimeout "writeinner()", 200
end if
end function
sub view()
strhtml1 = "<img src='" &window.event.srcelement.src &"' width='140' height='140'>"
preview.runtimestyle.pixelleft = window.event.x + 5
preview.runtimestyle.pixeltop = window.event.y + 5
preview.style.visibility = "visible"
preview.innerhtml = strhtml1
end sub
sub hideview()
preview.style.visibility = "hidden"
end sub
sub addpro()
set obj = window.event.srcelement.parentelement.parentelement.parentelement.parentelement
if obj.cells(0).children(0).children(0).checked = false then
obj.cells(0).children(0).children(0).checked = true
else
obj.cells(0).children(0).children(0).checked = false
end if
end sub
sub tb_del()
set obj = document.all.nameditem("mytable")
if obj.rows.length>2 then
set tagid = document.all.nameditem("addme") '获取对象id:delcheck'
for each otag in tagid
if otag.checked then
objrow = otag.parentelement.parentelement.parentelement.rowindex '获取对象的行序数;'
obj.deleterow(objrow) '删除该项;'
end if
next
else
msgbox "才一项你都删,哪有这样的?!", 0, "删除提醒"
exit sub
end if
end sub
sub selectall()
set obj = document.all.nameditem("mytable")
set objcheck = document.all.nameditem("sall")
set tagid = document.all.nameditem("addme") '获取对象id:addme'
for each otag in tagid
otag.checked = objcheck.checked
next
end sub
sub download()
set fso = createobject("scripting.filesystemobject")
if not (fso.folderexists("★网易下载图片★")) then
fso.createfolder("★网易下载图片★")
end if
set http = createobject("microsoft.xmlhttp")
set obj = document.all.nameditem("mytable")
set tagid = document.all.nameditem("addme") '获取对象id:delcheck'
for each otag in tagid
if otag.checked then
set objrow = otag.parentelement.parentelement.parentelement '获取对象的行;'
downurl = objrow.cells(1).children(0).children(0).children(0).src
filename = objrow.cells(3).children(0).innertext
http.open "get", downurl, false
http.send
set aso = createobject("adodb.stream")
aso.type = 1
aso.open
aso.write http.responsebody
aso.savetofile "★网易下载图片★\" & filename & "."&fileext, 2
aso.close
end if
next
infotext.innertext = infotext.innertext & vbcrlf & "文件下载成功。"
infotext.innertext = infotext.innertext & vbcrlf & "文件保存在:" & vbcrlf &"“★网易下载图片★”下"
end sub
sub downloadfile()
infotext.innertext = "正在下载文件...." '"
window.settimeout "download()", 200
end sub
sub changevalue()
aid = array("130", "112", "67", "14", "122", "158")
pid = array("90", "91", "89", "34", "198", "200")
if atype.selectedindex = 0 then
for i = 0 to 5
imagetype.options(i + 2).value = pid(i)
next
else
for i = 0 to 5
imagetype.options(i + 2).value = aid(i)
next
end if
end sub
</script>