- UID
- 19431
- 帖子
- 8141
- 精华
- 1
- 贡献
- 11
- 推广
- 0
- 有效BUG
- 0
- 来自
- 天井水脉
- 注册时间
- 2006-9-17
|
2#
发表于 2007-7-30 18:09
| 只看该作者
记得楼主说过自己很懒。 我就用狗狗搜索了一下。如下
<script language=VBScript>
dim EntryUrl
EntryUrl="这里是要置顶帖子的URL"
set HtmlRes=createobject("Microsoft.XMLHTTP")
HtmlRes.open "get",EntryUrl,false
HtmlRes.send
dim StartPos, EndPos, EntryText
StartPos = InStr(1, HtmlRes.responseText, "<div class=" & Chr(34) & "entry" & Chr(34) & ">", 1)
EndPos = InStr(1, HtmlRes.responseText, "<DIV id=" & Chr(34) & "comments" & Chr(34) & ">", 1)
EntryText= Mid(HtmlRes.responseText, StartPos, EndPos-StartPos-6) & "</div>"
EntryText=replace(EntryText,"<h2><a href=", "<h2><B>置顶: </B><a href=")
EntryText=replace(EntryText,"<h2><B>置顶: </B><a href=" & Chr(34) & "#" & Chr(34) & ">", "<h2><B>置顶: </B><a href=" & Chr(34) & EntryUrl & Chr(34) &">")
dim PosTable1, PosTable2
PosTable1=InStr(1, EntryText, "<table width=" & Chr(34) & "468", 1)
PosTable2=InStr(PosTable1, EntryText, "</table>", 1)
EntryText=Left(EntryText, PosTable1-1) & Right(EntryText, Len(EntryText)-PosTable2-7)
document.write EntryText
set HtmlRes=nothing
</script> |
|