Drupal can automatically send notifications (called \"pings\") to the following sites to tell them that your site has changed. To do so, Drupal implements the %weblogs-XML.
The ping feature requires crontab.
", array('%weblogs' => 'Weblogs.com', '%weblogs-XML' => ''. t('XML-RPC interface of weblogs.com') .'', '%weblogs-RSS' => ''. t('Weblogs.Com for RSS') .'', '%weblogs-RSS-changes' => ''. t('the weblogs.com for RSS') .'', '%blo-gs' => 'blo.gs','%blogtracker' => 'blogtracker', '%blogrolling' => 'blogrolling.com', '%blo-gs-XML' => ''. t('XML-RPC interface of blo.gs').'', '%technorati' => ''. t("Technorati"). '', '%yahoo' => 'My Yahoo!')); break; case 'admin/modules#description': $output = t('Alerts other sites that your site has been updated.'); break; } return $output; } /** * Implementation of hook_cron(). * * Fire off notifications of updates to remote sites. */ function ping_cron() { global $base_url; if (variable_get('site_name', 0) && variable_get('site_slogan', 0)) { if (db_num_rows(db_query("SELECT nid FROM {node} WHERE status = 1 AND moderate = 0 AND (created > '". variable_get('ping_cron_last', time()) ."' OR changed > '". variable_get('ping_cron_last', time()) ."')"), 1)) { _ping_notify(variable_get('site_name', '') .' - '. variable_get('site_slogan', ''), $base_url); } variable_set('ping_cron_last', time()); } } /** * Call hook_ping() in all modules to notify remote sites that there is * new content at this one. */ function _ping_notify($name, $url) { module_invoke_all('ping', $name, $url); } /** * Implementation of hook_ping(). * * Notifies weblogs.com, blo.gs, and technorati.com of changes at this site. */ function ping_ping($name = '', $url = '') { $feed = url('node/feed', NULL, NULL, TRUE); $client = new xmlrpc_client('/RPC2', 'rpc.weblogs.com', 80); $message = new xmlrpcmsg('weblogUpdates.ping', array(new xmlrpcval($name), new xmlrpcval($url))); $result = $client->send($message); if (!$result || $result->faultCode()) { watchdog('error', t('Failed to notify weblogs.com (site).')); } unset($client); $client = new xmlrpc_client('/RPC2', 'rssrpc.weblogs.com', 80); $message = new xmlrpcmsg('rssUpdate', array(new xmlrpcval($name), new xmlrpcval($feed))); $result = $client->send($message); if (!$result || $result->faultCode()) { watchdog('error', t('Failed to notify weblogs.com (RSS).')); } unset($client); $client = new xmlrpc_client('/', 'ping.blo.gs', 80); $message = new xmlrpcmsg('weblogUpdates.extendedPing', array(new xmlrpcval($name), new xmlrpcval($url), new xmlrpcval($url), new xmlrpcval($feed))); $result = $client->send($message); if (!$result || $result->faultCode()) { watchdog('error', t('Failed to notify blo.gs.')); } unset($client); $client = new xmlrpc_client('/rpc/ping', 'rpc.technorati.com', 80); $message = new xmlrpcmsg('weblogUpdates.ping', array(new xmlrpcval($name), new xmlrpcval($url))); $result = $client->send($message); if (!$result || $result->faultCode()) { watchdog('error', t('Failed to notify technorati.com.')); } unset($client); $client = new xmlrpc_client('/RPC2', 'api.my.yahoo.com', 80); $message = new xmlrpcmsg('weblogUpdates.ping', array(new xmlrpcval($name), new xmlrpcval($feed))); $result = $client->send($message); if (!$result || $result->faultCode()) { watchdog('error', t('Failed to notify yahoo.com.')); } } ?>