XML-RPC protocol to achieve the Ping function of Baidu and Google

Source: Internet
Author: User

Baidu and Google provide the site update automatically submitted interface, interface protocol is based on XML-RPC.

XML-RPC is a Remote Procedure Call (remoteProgramThe Distributed Computing protocol of Remote Procedure Call (RPC) encapsulates call functions using XML and uses http protocol as the transmission mechanism. Functionality is similar to JSON-RPC protocols. The principle is the same, but the data is transmitted in JSON format.

The benefit of using XML-RPC protocols is the ability to automatically notify search engines when the website has content updates, without passively waiting for spider crawling.

Baidu and Google interfaces follow the XML-RPC protocol, the interface names and parameters of different search engines may be slightly different, we can adjust according to the search engine provided by the API.

To implement this function, you need to use an open-source component: cookcomputing. XMLRPC. The component provides all the features of the XML-RPC protocol, including WordPress client support.

 

Take Google as an example to provideCode:

 

Using System;
Using Cookcomputing. XMLRPC;
Public Interface Imath: ixmlrpcproxy
{
[Xmlrpcmethod ( " Weblogupdates. Ping " )]
Cookcomputing. XMLRPC. xmlrpcstruct Ping ( String A, String B, String C, String D );
}

 Public ClassTest
{
PrivateImath googleproxy = xmlrpcproxygen. Create <imath> ();

Public Void Ping ()
{
Googleproxy. url = " Http://blogsearch.google.com/ping/RPC2 " ;
Googleproxy. Ping ( " Love creating Novels " , " Http://www.aizr.net/ " , " Http://www.aizr.net/Search.aspx? M = 4 & Key = % E6 % 9d % 83% E8 % B4 % A2
" , " HTTP: // Www.aizr.net/rss.aspx ");
}
}

 

 

 

 

 

In this way, a simple web site is submitted to the search engine. In fact, the XML-RPC function is far more than these, if you have a unique understanding of the XML-RPC agreement, you are welcome to come and discuss with me. If this article is misleading to you, I am so ashamed of myself.

 

 

Recommended: daluo land

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.