登录 | 首页 -> 华新鲜事 -> 社会百科 | 切换到:传统版 / sForum | 树形列表
a question regarding webpage design
<<始页  [1]  末页>> 

a question regarding webpage designthis project is to create a website for the company. one requirment is that the website can "extract" updated information from its competitor's website, which means, when i open our company's website, I can see updated info if the competitor's website updates.
how to realise this function? use what kind of programming language?
[楂楂兔 (1-14 12:59, Long long ago)] [ 传统版 | sForum ][登录后回复]1楼

这也太阴了吧。。how about write a program that run in background, maybe run 10 mins once, to get those information and then save in xml or txt or ini whatever files

each time ur company's main page loads, u can read from those files and decide what to do..
[hula (1-14 13:18, Long long ago)] [ 传统版 | sForum ][登录后回复]2楼

(引用 hula:这也太阴了吧。。how about write a program that run in background, maybe run 10 mins once, to get those information and then save...)i found some infobut not very sure about it.
----->

如何利用xml来截取别人网站的内容

将下面代码保存为html格式,只要你的浏览器版本在IE5.0以上就行了.由于要数据要经过转换所以速度会有点慢,不知大家有什么好的方法欢迎一起来讨论lzppcc@21cn.com

<script language="VBScript">
Option Explicit
Dim NextCharCode,ThisCharCode,i,strReturn,Retrieval,T,Start,Start2,get_url,start_char,end_char,start_char_len

get_url="http://news.sina.com.cn/news1000.shtml" //---要截取的页面
start_char="<!--新闻开始-->" //要从哪个地方开始截取
end_char="<!--新闻结束-->" //到哪个地方结束
start_char_len=len(start_char) //开始字符串长度


T=GetURL(get_url)
T=bytes2BSTR(T) //将数据转换为字符型式
start=Instr(1,t,start_char)
start2=Instr(start,t,end_char)
t=mid(T,start+start_char_len,start2-start-start_char_len) //取出数据
document.write t


Function GetURL(url)
Set Retrieval = CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "GET", url, False, "", ""
.Send
'GetURL = .ResponseText
GetURL = .Responsebody
End With
Set Retrieval = Nothing
End Function

Function bytes2BSTR(vIn)
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 = strReturn
End Function
</script>

[楂楂兔 (1-14 15:05, Long long ago)] [ 传统版 | sForum ][登录后回复]3楼

(引用 楂楂兔:i found some infobut not very sure about it. -----> 如何利用xml来截取别人网站的内容 将下面代码保存为html格式,只要你的浏览器版...)there's also a softwarewhich dose the similar thing.
WebNews是一个自动帮助你更新你的主页上的及时性信息的工具软件,它从更新频率 较高的网站截取最新的信息,生成可以直接嵌入到自己的网页中的 JS 文件,只需在 网页的适合的地方放至类似<script language=javascript src="xxxxxx.JS"></script>的语句你的网页就可以时时有更新的内容了,特别适合 中小网站个人网站等没有采编能力的网站使用,以吸引更多的人来访问。

[楂楂兔 (1-14 15:05, Long long ago)] [ 传统版 | sForum ][登录后回复]4楼


<<始页  [1]  末页>> 
登录 | 首页 -> 华新鲜事 -> 社会百科 | [刷新本页] | 切换到:传统版 / sForum