找回密码
 注册
搜索
热搜: 回贴
  • 前程无忧官网首页 有什么好的平台可以
  • 最新的销售平台 互联网营销的平台有哪
  • 制作网页的基本流程 网页制作和网页设
  • 【帝国CMS】输出带序号的列表(数字排
  • 网站建设公司 三一,中联,极东泵车的
  • 织梦 建站 织梦网站模版后台怎么更改
  • 云服务官网 哪些网站有免费的简历模板
  • 如何建网站要什么条件 建网站要用什么
  • 吉林市移动公司电话 吉林省退休人员网
  • 设计类毕业论文 网站设计与实现毕业论
查看: 7477|回复: 2

百度博客目录提取工具(HTM版)

[复制链接]
发表于 2009-12-2 00:14:31 | 显示全部楼层 |阅读模式 IP:江苏扬州
<html><head>
<title>HTML版目录提取工具</title></head>
<style type='text/css'> body{font-size: 10pt;} a{color: #000000;text-decoration : none;font-size: 10pt;} a:hover {color: red;text-decoration : underline;} td{color: #000000;text-decoration : none;font-size: 10pt;}
</style>

<SCRIPT LANGUAGE="JavaScript">
<!--
function chkacc(){
j=document.getElementById("startnum").value;
v=document.getElementById("endnum").value;
w=document.getElementById("host").value;
g1=document.getElementById("checkMulu").checked;
g2=document.getElementById("TexMulu").value;
g3=document.getElementById("checkHtm").checked;
g4=document.getElementById("checkDate").checked;
g5=document.getElementById("checkLei").checked;
jmdcw=j + "|" + v + "|" + w + "|" + g1+ "|" + g2 + "|" + g3 + "|" + g4 + "|" + g5;
dq(jmdcw);
}
//-->
</SCRIPT>

<Script language=VBScript>
dim datec,leic,htmc,username
dim IDnum
Function bytes2BSTR(vIn) 'utf8转换函数
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
bytes2BSTR = jmtiqu(strReturn)

End Function

Function dq(start)'远程抓取函数
dim XmlHttp
zifu=split(start,"|")
datec=zifu(6)
leic=zifu(7)
htmc=zifu(5)
username=zifu(2)
If zifu(3)="true" then
FileUrl1 = "http://hi.baidu.com/" & URLEncoding(username) & "/blog/category/" & zifu(4) & "/index/"
else
FileUrl1 = "http://hi.baidu.com/" & URLEncoding(username) & "/blog/index/"
end if

if datec="true" then
BiaoTouD="<td>时 间</td>"
else
BiaoTouD=""
end if

if leic="true" then
BiaoTouL="<td>类 别</td>"
else
BiaoTouL=""
end if

sminfo.innerHTML = "<h4 align=center>" & zifu(2) & "的博客目录</h4><hr><div align='center'><table border=1><tr align=center><td>ID</td><td>文 章目 录</td>" & BiaoTouD & BiaoTouL & "</tr>" & vbCrLf
IDnum=1
for k=int(zifu(0)) to int(zifu(1))
url=FileUrl1 & k
set XmlHttp = CreateObject("Microsoft.XMLHTTP")
XmlHttp.Open "GET",url, false
XmlHttp.setRequestHeader "Content-Type","text/XML"
XmlHttp.Send
dq = bytes2BSTR(XmlHttp.responseBody)
next

sminfo.innerHTML =sminfo.innerHTML + "</table></div><br><p><hr><center><A href='http://hi.baidu.com/jmdcw' target=_blank> JMDCW </a>制作-- 2007.06 </center></body></html>"
End Function

Function JmTiQu(BaiHtml) '提取相关内容,JMDCW编写
Dim BaiDu
UrlStart = "<div class=" & Chr(34) & "tit" & Chr(34) & "><a href=" & Chr(34) & "/"
Const UrlEnd = "/"
NameStart = Chr(34) & " target=" & Chr(34) & "_blank" & Chr(34) & ">"
Const NameEnd = "</a></div>"
DataStart = "<div class=" & Chr(34) & "date" & Chr(34) & ">"
LeiStart = Chr(34) & ">类别:"
ChaXu1 = UrlStart & URLEncoding(UserName) & UrlEnd
BaiDu = ""

Startme = 1 '定义首先为1位
Do While Startme <> 0
Where1 = InStr(Startme, BaiHtml, ChaXu1) '得到HTML的头部
Startme = Where1
If Startme = 0 Then Exit Do
Where2 = InStr(Startme, BaiHtml, NameStart) '得到HTLM的尾部
Startme = Where2
If Startme = 0 Then Exit Do
Where3 = InStr(Startme, BaiHtml, NameEnd) '得到文章的尾部
Startme = Where3
If Startme = 0 Then Exit Do
Where4 = InStr(Startme, BaiHtml, DataStart) '得到日期的头部
Startme = Where4
If Startme = 0 Then Exit Do
Where5 = InStr(Startme, BaiHtml, "</div>") '得到日期的尾部
Startme = Where5
If Startme = 0 Then Exit Do
Where6 = InStr(Startme, BaiHtml, LeiStart) '得到类别的头部
Startme = Where6
If Startme = 0 Then Exit Do
Where7 = InStr(Startme, BaiHtml, "</a>") ' 得到类别的尾部
Startme = Where7

If Where7 <> 0 Then
'BaiHtmStr = Mid(BaiHtml, Where1 + Len(ChaXu1), (Where2 - Where1 - Len(ChaXu1))) 'html
'BaiHtmStr = "http://hi.baidu.com/" & URLEncoding(UserName) & "/" & BaiHtmStr
BaiFileStr = Mid(BaiHtml, Where2 + Len(NameStart), (Where3 - Where2 - Len(NameStart))) '文章

BaiDu = BaiDu & "<tr><td>" & IDnum & "</td>"

if htmc="true" then
BaiHtmStr = Mid(BaiHtml, Where1 + Len(ChaXu1), (Where2 - Where1 - Len(ChaXu1))) 'html
BaiHtmStr = "http://hi.baidu.com/" & URLEncoding(UserName) & "/" & BaiHtmStr
BaiDu = BaiDu & "<td><a href='" & BaiHtmStr & "' target='_blank'>" & BaiFileStr & "</a></td>"
else
BaiDu = BaiDu & "<td>" & BaiFileStr & "</td>"
end if
' BaiDu = BaiDu & "<tr><td><a href='" & BaiHtmStr & "' target='_blank'>" & BaiFileStr & "</a></td>"
if datec="true" then
BaiDate = Mid(BaiHtml, Where4 + Len(DataStart), (Where5 - Where4 - Len(DataStart))) '日期
BaiDate = Left(BaiDate, 11) & " " & Right(BaiDate, 5)
BaiDu = BaiDu & "<td>" & BaiDate & "</td>"
end if

if leic="true" then
BaiLei = Mid(BaiHtml, Where6 + Len(LeiStart), (Where7 - Where6 - Len(LeiStart))) '类别
BaiDu = BaiDu & "<td>" & BaiLei & "</td>"
end if

BaiDu = BaiDu & "</tr>"
IDnum=IDnum+1
End If
Loop
sminfo.innerHTML = sminfo.innerHTML + BaiDu
End Function

Function URLEncoding(vstrin) '转换汉字为十六进制字符 ,来源于网络
StrReturn = ""
Dim i
For i = 1 To Len(vstrin)
ThisChr = Mid(vstrin, i, 1)
If Abs(Asc(ThisChr)) < &HFF Then
StrReturn = StrReturn & ThisChr
Else
InnerCode = Asc(ThisChr)
If InnerCode < 0 Then
InnerCode = InnerCode + &H10000
End If
Hight1 = (InnerCode And &HFF00) \ &HFF
Low1 = InnerCode And &HFF
StrReturn = StrReturn & "%" & Hex(Hight1) & "%" & Hex(Low1)
End If
Next
URLEncoding = StrReturn
End Function

</script>

<body>
<div align="center"><font color=red>HTML版目录提取工具</font><br>
<FORM METHOD=POST ACTION="" name="frm2">
开始页次:<input type="text" name="startnum" size=3 id="startnum"> 结束页次<input type="text" name="endnum" size=3 id="endnum"><br>
用户的域名: <input type="text" name="host" id="host"><br>
高级:<input type="checkbox" name="checkMulu" id="checkMulu">按分类提取 <input type="text" name="TexMulu" size=12 value="默认分类" id="TexMulu"><br>
生成目录选项 <input type="checkbox" name="checkHtm" id="checkHtm" checked>链接
<input type="checkbox" name="checkDate" id="checkDate" checked>时间
<input type="checkbox" name="checkLei" id="checkLei" checked>分类 <br>
<INPUT TYPE="button" value=" 提 取 " name="btnchk" onclick="chkacc();">
</FORM></div>
<div id="sminfo"></div>

</body>

</html>
发表于 2010-1-29 04:05:04 | 显示全部楼层 IP:广东
虎躯一震,三分走人
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )

GMT+8, 2024-10-1 15:19 , Processed in 0.259075 second(s), 15 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表