网站新闻收集系统的设计与实现
2012-04-29仇兆存
仇兆存
摘要:为了使用户更加方便地查看新闻信息,不受时间或是网络资源等条件的制约,也可以做为自动生成新闻网页的新闻类网站提供信息来源,该系统以面向对象的设计思想,采用Java语言,凭借Eclipse3.1的开发工具,对网站新闻信息进行了搜集。在可移植性和可维护性等方面有较好的体现。其中运用了多线程的方法对新闻信息进行了快速的下载、整理与收集,为用户查阅新闻信息提供了方便,节省了大量时间。
关键词:面象对象;多线程;新闻搜集;正则表达式
中图分类号:TP311文献标识码:A文章编号:1009-3044(2012)05-1098-04
The Design and Implementation of News-gathering System for Website
QIU Zhao-cun
(Jiangsu Radio and Television University Jiangdu College, Yangzhou 225200, China)
Abstract: To enable users to more easily view news and information, without the restriction of time or network resources and other condi? tions, the system can provide original information for the news website that can automatically generate news pages. The system relys on the object-oriented design idea, Java language, and the development tools of Eclipse3.1, to gather information for the site. It has better perfor? mance in portability and maintainability and other aspects. The system can realize fast download, arrangement and collection of the news and information by using multi-threaded approach, and make it convenient for users to access news and information.
Key words: object-oriented; multi-threading; news gathering; regular expression
如今,网络在人们生活和工作中起着越来越重要的作用,而从网上获取新闻信息更是成了很多人获知新闻的主要渠道。如果拥有自己的网站,为了让更多的人来浏览,就必须进行及时更新,可以从那些大的网站中找出想要的新闻信息然后转载过来,然而,这些网站上的信息量巨大,如果仅仅靠人工方式进行机械的拷贝,那将显得效率太低且繁琐,其实,我们可以编写程序让程序来完成这些工作。
1需求分析
1.1现状分析
现代人的生活已经越来越离不开互联网络了。我们的语言中已经由于网络而增加了许多新鲜的血液,通讯交流由于网络而变得更加方便快捷,知识的更新速度也由于网络而加快……中国互联网的发展迅速,为了对中文信息处理作一些研究,我们需要先从网络中收集部分相关的信息。163和TOM两个网站的信息量较大,故将这两个网站作为目标站点,从中收集原始数据。
