PDA

查看完整版本 : 有熟悉python 的吗? 问一个建立google sitemap 的问题


filalu
2006-02-04, 10:11 PM
因为sitemap 需要运行一个python 命令
所以我给我的虚拟主机客服写了一封信问了一下
下面是他们的回复

We support python on all levels of hosting so that should work (if it
involves php calling files by their URL/http:// that will fail though as
that is disabled... it's just a guess as to what might be happening if
you tried to install and run it).

看来这个主机是支持python 的
想知道的是怎么运行这个命令呢?

下面是g sitemap 的安装步骤:

下载 Sitemaps 生成器程序文件。将这些文件解压缩到本地目录。
使用提供的 example_config.xml 文件作为模板,为您的网站创建配置文件。根据需要为网
站修改此文件,然后保存。
将必要的文件上传到您的 Web 服务器。
运行 sitemap_gen.py。
添加生成的 Sitemaps 到您的 Google Sitemaps 帐户。
设置递归脚本。(可选)

我没有用过python
是不是需要像shell 那样安装一个客户端?
哪位大大做过sitemap 能不能指点一下

--

licheng
2006-02-04, 11:23 PM
Python 我不是很熟,不過,常安裝 Python 開發的程式,算是有點兒經驗。譬如 Zope (http://www.zope.org/)。

可是,嗯,上述那段說明,中文的部分看不懂。 ~dead

大陸的術語,跟臺灣這兒不太一樣。 :?

filalu
2006-02-04, 11:34 PM
谢谢..
知道了现在
用ssh, 就是shell 的客户端就能运行python 命令

不过出错了还是
就是显示不能写文件
这个已经写信向主机商问了

哈啦
2006-02-05, 01:14 AM
要快速制作一般網站的sitemap可參考:
http://www.webmasterclub.org/showthread.php?t=96

要製作vBulletin論壇的sitemap可參考:
http://www.webmasterclub.org/showthread.php?t=110

ismile
2006-02-05, 05:47 AM
看看你的 config.xml (或設定檔名) 是否設定正確 (sitemap.xml 的路徑、取得資料的方式 (log 或原有的 sitemap)),再來 sitemap.xml 要在網頁根目錄。



谢谢..
知道了现在
用ssh, 就是shell 的客户端就能运行python 命令

不过出错了还是
就是显示不能写文件
这个已经写信向主机商问了

filalu
2006-02-05, 07:23 AM
看看你的 config.xml (或設定檔名) 是否設定正確 (sitemap.xml 的路徑、取得資料的方式 (log 或原有的 sitemap)),再來 sitemap.xml 要在網頁根目錄。

谢谢....
显示结果是下面这样:
$ python sitemap_gen.py --config=config.xml
Reading configuration file: config.xml
Walking DIRECTORY "/"
Sorting and normalizing collected URLs.
Writing Sitemap file "/sitemap.xml" with 50000 URLs
[B][FATAL] Couldn't write out to file: /sitemap.xml

应该是没有写的权限的问题吧?

filalu
2006-02-05, 07:53 AM
....
faint
现在这个命令运行一半就中断
被服务器那边ban 掉了可能

ismile
2006-02-05, 08:20 AM
查看看 config.xml,


<site
base_url="http://[domain_name]/"
store_into="/path-to/sitemap.xml"
verbose="1"
>


sotre_into 是真實路徑 (real path)。可以登入 shell,到網頁的目錄,打 "pwd"。把出現的路徑,放到 "sotre_into"

ismile
2006-02-05, 08:22 AM
然後在測試時,在指令後加 "--testing",如

python sitemap_gen.py --config=config.xml --testing

這樣不會立即送 request 到 google

到確定可以執行無誤,在把 --testing 拿掉

filalu
2006-02-05, 09:07 AM
非常感谢!... 就是这个原因

filalu
2006-02-05, 10:01 AM
网站页面很多,有100多万个页面
它好像写满了一个sitemap.xml
就马上开始写sitemap1.
这时候就停住不动了,现在已经一个多小时了还不动
是因为死循环还是别的原因?

我重复了一遍,还是到这里就停下来了


--------------------
问题解决,还是目录设置的问题