A piece of code to make Baidu seconds to collect your site

Source: Internet
Author: User

Believe that Baidu is not included in many webmaster, in particular, novice webmaster one of the most headaches, we all day original + pseudo original, but Baidu is motionless, which makes the webmaster a bit feel that the hot face affixed to Baidu's cold butt, over time there is a sense of frustration, which is why many webmasters can not adhere to the last one of the reasons.

Directly on dry goods, a piece of code so that Baidu will be more or less the picture has the truth, with WordPress or Zblog webmaster know, the program itself with the Ping service, the release of the article will automatically inform the search engine to be included, practice proves WordPress as long as your article quality is not too bad, Outside the chain sent to the higher weight of the place, then included is very easy, and the second is not so difficult to collect.

  

However, if it is their own handwritten procedures, the problem comes, especially a lot of comparison dishes webmaster, is to take someone else's source code, how to add the latest introduction of Baidu Ping service function, so as to speed up the article included speed. The following is a section of Baidu Ping service PHP code:

$baiduXML = <<<eot
<?xml version= "1.0" encoding= "UTF-8"?>
<methodCall>
<methodName>weblogUpdates.extendedPing</methodName>
<params>
<PARAM><VALUE><STRING>A5 Starter </string></value></param>
<param><value><string>http://www.***.com</string></value></param>
</params>
</methodCall>
EOT;
$res = PostURL (' http://ping.baidu.com/ping/RPC2 ', $baiduXML);
The following is the decision to return success (according to Baidu Ping Interface description)
if (Strpos ($res, "<int>0</int>"))
echo "Ping successful";
Else
echo "Ping failed";

As long as you save it to any name such as pingbaidu.php, and then perform the add operation, jump to the pingbaidu.php page ok! You can use this code:

<?php Header ("location:http://www.pingbaidu.php;? >

I hope that you use the above Baidu Ping service function, can realize the article seconds, reverse passive anxious situation.

This article by http://www.bestfxjy.net webmaster A5 starting, Welcome to reprint Exchange can leave a link best!



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.