Baidu/Google Ping

Source: Internet
Author: User
Provides a variety of official and user-released code examples. For code reference, you are welcome to learn about Baidu/Google Ping, notification crawler crawling, second receiving is not a dream
The last time I saw an article about Ping, I used Ping in my blog. Here I overwrote the Ping class and added some configuration items in the class, makes it easier to use.
The main configuration items are: // Ping Configuration
'Ping _ config' => array (
'Is _ PING_ON '=> 0, // whether to enable Ping; 1: Enable Ping; 0: Disable; default: Disable
'Site _ name' => 'personal website', // website NAME
'Site _ url' => 'HTTP: // www.xxx.com/', // website address
'Update _ url' => 'HTTP: // www.xxx.com/', // basic website address
'Update _ RSS_URL '=> '', // The updated Rss address cannot be blank.
),
When Ping is enabled, it is easy to use the class. You only need to input an id: Import ('class. ping', APP_PATH); // import the Ping Class
$ Ping = new Ping (10); // input the id of the inserted article
If (! $ Ping-> google () |! $ Ping-> baidu ()){
If (! $ Ping-> google ()){
$ This-> error ('Google Ping failed ');
} Else {
$ This-> error ('Baidu Ping failed ');
}
} Else {
$ This-> success ('Ping successful ');
}
You can also set parameters when you do not set the configuration items. The usage is as follows: Import ('class. ping', APP_PATH); // import the Ping Class
$ Param = array ('site _ name' => 'personal website', 'site _ url' => 'wei416978817 .byethost33.com/', 'id' => 10, 'updata _ rss_url '=> '');
$ Ping = new Ping ($ param );
If (! $ Ping-> google () |! $ Ping-> baidu ()){
If (! $ Ping-> google ()){
$ This-> error ('Google Ping failed ');
} Else {
$ This-> error ('Baidu Ping failed ');
}
} Else {
$ This-> success ('Ping successful ');
}
It's really easy to use! In the past, Google was always not included. I pinged it and showed the effect yesterday.

If you are free, go to http://wei416978817.byethost33.com/and give me some traffic. It's a pity .... % >_< %

Ping.class.rar (1.92 KB download: 115 times)

AD: truly free, domain name + VM + enterprise mailbox = 0 RMB

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.