Document directory
Google help: http://www.google.com/help/blogsearch/pinging_API.html
By using Google's "blog search" Ping API, users can send Blog content update notifications to Google's "blog search" engine in a programmatic manner. This is especially useful for users who frequently update Blog content. The management staff of the blog service provider can also use this API to notify Google of Blog content changes on its platform, so that Google "blog search" can capture the latest content from this service provider in a timely manner. To set an automatic Ping mechanism for Google blog search, set the XML-RPC client or REST client as described below to send requests. You can use either of the two methods for notification. Both methods are handled in the same way.
Set XML-RPC customer
Requests from XML-RPC customers should contain the following elements:
RPC endpoint:Http://blogsearch.google.com/ping/RPC2
Call Method Name:WeblogUpdates. extendedPing
Parameters:(Transmitted in the same sequence as listed below)
- Site name
- Site URL
- Page URL to be updated
- URL of the corresponding RSS, RDF, or Atom Seed
- OptionalThe category name (or tag) of the page content ). You can specify multiple values separated by the '|' character.
The XML-RPC response returns the <struct> with two elements:
- Flerror (Boolean): Set to true/1 when an error occurs.
- Message (string): "Thanks for the ping." (if successful) or an error message (if not ).
Example of a XML-RPC request
POST /RPC2 HTTP/1.0User-Agent: requestHost: blogsearch.google.comContent-Type: text/xmlContent-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>
Example of a XML-RPC response
HTTP/1.1 200 OKConnection: closeContent-Length: 451Content-Type: text/xmlDate: Sun, 30 Sep 2001 20:02:30 GMTServer: 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>
Set REST customers
REST client requests contain the following elements:
URL:Http://blogsearch.google.com/ping
Parameters:
- Name = blog name
- Url = blog URL
- ChangesURL = URL of RSS, RDF, or Atom seeds (optional)
The text content will be returned in the response. If the response succeeds, it is "Thanks for the ping." and an error message is returned when the response fails.
Example:
Http://blogsearch.google.com/ping? Name = Official + Google + Blog & url = http % 3A % 2F % 2Fgoogleblog.blogspot.com % 2F & changesURL = http % 3A % 2F % 2Fgoogleblog.blogspot.com % 2Fatom. xml
Changes. xml format
Google publishes the received "blog search" Ping record in XML format to http://blogsearch.google.com/changes.xml. The format of the changes. xml file contains one <weblogUpdates> root element and one or more <weblog> elements.
<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> element
- Version: Used to indicate a major format change. The current version is 2.
- Updated: Date and Time in HTTP 1.0 format. It indicates the last update time of the file.
- Count: An incremental number that indicates the version of the changes. xml file. The new changes. xml file usually has a larger count value.
<Weblog> element
- Name: The name of the Blog.
- Url: The url of the Blog.
- RssUrl: The URL of the corresponding RSS, Atom, or other seeds.
- When: The difference between the time corresponding to the updated attribute of the <weblogUpdates> element and the time when the corresponding Ping occurs, in seconds.