写一个定制的模块 ping 一系列站点

如果你希望通知的站点没有使用 ping-o-matic,你可以使用下面的更新。

来自: http://drupal.org/node/29704

替换 ping.module:ping_ping 为下面的代码。 兼容 drupal 4.6.3

/**
* 执行 hook_ping().
*
* 通知 pingomatic.com, blo.gs, 和 technorati.com 本站已经改变。
*/
function ping_ping($name = '', $url = '') {
$result = xmlrpc('http://rpc.pingomatic.com', 'weblogUpdates.ping', $name, $url);
if ($result === FALSE) {
watchdog('directory ping', t('Failed to notify pingomatic.com (site).'), WATCHDOG_WARNING);
} else {
watchdog("directory ping", t('successfully notified pingomatic.com (site).'), WATCHDOG_NOTICE);
}
unset($result);
$result = xmlrpc('http://rpc.technorati.com/rpc/ping', 'weblogUpdates.ping', $name, $url);
if ($result === FALSE) {
watchdog('directory ping', t('Failed to notify technorati.com (site).'), WATCHDOG_WARNING);
} else {
watchdog("directory ping",t('successfully notified technorati.com (site).'), WATCHDOG_NOTICE);
}
unset($result);
$result = xmlrpc('http://ping.blo.gs', 'weblogUpdates.ping', $name, $url);
if ($result === FALSE) {
watchdog('directory ping', t('Failed to notify blo.gs (site).'), WATCHDOG_WARNING);
} else {
watchdog("directory ping", t('successfully notified blo.gs (site).'), WATCHDOG_NOTICE);
}
unset($result);
}

- David Herron - http://7gen.com/