linlu11 的博客

2009-10-26 | 修改drupal的ping模块以便ping中文搜索引擎

标签: ping watchdog site directory google

将ping模块下的文件中的ping_ping()模块作如下修改:
function ping_ping($name = '', $url = '') {
  // google.com
  // ----------------------
  $result = xmlrpc('http://blogsearch.google.com/ping/RPC2', 'weblogUpdates.ping', $name, $url);
  if ($result === FALSE) {
    watchdog('directory ping', t('Failed to notify pingomatic.com (site).'), array(), WATCHDOG_WARNING);
  } else {
     watchdog('directory ping', t('Successfully notified pingomatic.com (site).'), array(), WATCHDOG_NOTICE);
  }
  // iask.com
  // ----------------------
  $result = xmlrpc('http://blog.iask.com/RPC2', 'weblogUpdates.ping', $name, $url);
  if ($result === FALSE) {
    watchdog('directory ping', t('Failed to notify Technorati.com (site).'), array(), WATCHDOG_WARNING);
  } else {
    watchdog('directory ping', t('Successfully notified Technorati.com (site).'),  array(), WATCHDOG_NOTICE);
  }
  // qikoo.com
  // --------------------------
  $result = xmlrpc('http://ping.blog.qikoo.com/rpc2.php', 'weblogUpdates.ping', $name, $url);
  if ($result === FALSE) {
    watchdog('directory ping', t('Failed to notify Feedburner.com (site).'),  array(), WATCHDOG_WARNING);
  } else {
    watchdog('directory ping', t('Successfully notified Feedburner.com (site).'),  array(), WATCHDOG_NOTICE);
  }
}

posted on 2010-03-18 22:09  linlu11  阅读(257)  评论(0编辑  收藏  举报

导航