當前位置:首頁 » 編程語言 » php百度蜘蛛

php百度蜘蛛

發布時間: 2025-01-29 05:10:36

Ⅰ 如何用php代碼來判斷搜索引擎蜘蛛來路

根據$_SERVER['HTTP_REFERER']判斷來路

根據$_SERVER['HTTP_USER_AGENT']來識別訪問者身份

比如
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322, Bai-Transcoder/1.0.6.0, gate..com)

msnbot/1.1 (+http://search.msn.com/msnbot.htm)

Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
……

你是不是想以這種方式,加入無關關鍵詞,搜索作弊?可能會被懲罰的,慎用

Ⅱ php搜索引擎蜘蛛程序

推薦一個國外知名度頗高的搜索引擎,含有網頁蜘蛛程序,以前好象有人想要這方面的資料,現在有了,大家可以研究下源碼

官方網站:
http://phpdig.toiletoine.net/

演示:
http://phpdig.toiletoine.net/sea ... te=100&option=start

中文版本和演示,我以前提供過(1.62版本的漢化),2003年11月換空間的時候沒備份,沒了。找下載了的人看看有沒有。

下載:
這是最近(2003年12月)更新的版本的下載(1.65 En):
http://www.phpdig.net/navigation.php?action=download

演示:
http://www.phpdig.net/navigation.php?action=demo

主要功能:
類似google、網路的搜索引擎,php+mysql

PhpDig is a http spider/search engine written in Php with a MySql database in backend.

HTTP Spidering : PhpDig follows links as it was any web browser within a web server, to build the pages list to index. Links can be in AreaMap, or frames. PhpDig supports relocations. Any syntax of HREF attribute is followed by Phpdig.
PhpDig don't go out the root site you define for the indexing. Spidering depth is choosen by user.
All html content is listed, both static and dynamic pages. PhpDig searches the Mime-Type of the document, or tests existence of an tag at the beginning of it.

支持全文搜索
Full Text indexing : PhpDig indexes all words of a document, excepting small words (less than 3 letters) an common words, those are definded in a text file.
Lone numbers are not inded, but those included in words. Underscores make part of a word.
Occurences of a word in a document is saved. Words in the title can have a more important weight in ranking results.

支持多種格式文件的索引,如pdf
File types wich can be indexed : PhpDig indexes HTML and text files by itself.
PhpDig could index PDF, MS-Word and MS-Excel files if you install external binaries on the spidering machines to this purpose.
To demonstrate the feature, you can search into Hamlet (tragedy, William Shakespeare) in MS-Word format, and L'Avare (comedy, Molière) in Pdf format.

支持robots
Other features : PhpDig Tries to read a robots.txt file at the server root. It searches meta robots tags too.
The Last-Modified header value is stored in the database to avoid rendant indexing. Also the meta revisit-after tag.

可針對特定網站進行全文索引,蜘蛛可1-9個層自動獲取全部url

其中的蜘蛛程序寫得十分好,有興趣的朋友推薦研究下。

希望對你有用!

熱點內容
ins海外伺服器ip是什麼 發布:2025-03-06 23:44:59 瀏覽:354
我的世界java版伺服器推薦ip 發布:2025-03-06 23:43:17 瀏覽:562
如何取消微信帳號和密碼 發布:2025-03-06 23:39:20 瀏覽:789
emc存儲備份 發布:2025-03-06 23:35:02 瀏覽:835
蘭州編程培訓 發布:2025-03-06 23:30:51 瀏覽:302
電信託管伺服器阿里雲 發布:2025-03-06 23:27:07 瀏覽:592
艾力紳混動哪個配置值得買 發布:2025-03-06 23:20:30 瀏覽:194
QT靜態編譯64 發布:2025-03-06 23:09:35 瀏覽:283
聖安地列斯自由伺服器ip 發布:2025-03-06 23:09:34 瀏覽:709
安卓怎麼掃二維碼 發布:2025-03-06 23:04:49 瀏覽:515