关于 Google“博客搜索”Ping 服务应用编程接口(API)
|
|
Google“博客搜索” |
通过 Google“博客搜索”Ping API, 用户可以程序化的方式将博客内容的更新通知给 Google“博客搜索”引擎。这对于经常更新博客内容的用户尤其有用。博客服务提供商的管理人员也可以利用此API将其平台上的博客内容变化向 Google 通告,以便 Google“博客搜索”及时抓取来自这一服务提供商的最新内容。为设置对 Google“博客搜索”的自动 Ping 机制,请按照如下所述设置XML-RPC客户端或REST客户端以发送请求。您可以任选一种方法进行通知;两者都将按照相同的方式进行处理。
XML-RPC客户的请求应包含如下元素: RPC端点: http://blogsearch.google.com/ping/RPC2
XML-RPC响应中将返回含有两个元素的<struct> :
XML-RPC请求的例子 POST /RPC2 HTTP/1.0
User-Agent: request
Host: blogsearch.google.com
Content-Type: text/xml
Content-length: 447
<?xml version="1.0"?>
<methodCall>
<methodName>weblogUpdates.extendedPing</methodName>
<params>
<param>
<value>Official Google Blog</value>
</param>
<param>
<value>http://googleblog.blogspot.com/</value>
</param>
<param>
<value>http://googleblog.blogspot.com/</value>
</param>
<param>
<value>http://googleblog.blogspot.com/atom.xml</value>
</param>
</params>
</methodCall>
XML-RPC响应的例子 HTTP/1.1 200 OK
Connection: close
Content-Length: 451
Content-Type: text/xml
Date: Sun, 30 Sep 2001 20:02:30 GMT
Server: Apache
<?xml version="1.0"?>
<methodResponse>
<params>
<param>
<value>
<struct>
<member>
<name>flerror</name>
<value>
<boolean>0</boolean>
</value>
</member>
<member>
<name>message</name>
<value>Thanks for the ping.</value>
</member>
</struct>
</value>
</param>
</params>
</methodResponse>
REST客户的请求中包含如下元素: URL: http://blogsearch.google.com/ping 参数:
例子:
Google 将所接受的“博客搜索” Ping 记录以XML格式发布到http://blogsearch.google.com/changes.xml。changes.xml文件格式包含一个根元素<weblogUpdates>和一个或多个的<weblog>元素。 <weblogUpdates version="2" updated="Wed, 30 May 2006 14:10:00 GMT" count="1384779">
<weblog name="Some Blog"
url="http://googleblog.blogspot.com"
rssUrl="http://googleblog.blogspot.com/atom.xml"
when="1"/>
...
</weblogUpdates>
<weblogUpdates>元素
<weblog>元素
|
转自:http://www.google.com/intl/zh-CN/help/blogsearch/pinging_API.html

浙公网安备 33010602011771号