1. drupal
    1. 4.7
    2. 5
    3. 6
Versions
4.7 – 6 hook_ping($name = '', $url = '')

Ping another server.

This hook allows a module to notify other sites of updates on your Drupal site.

Parameters

$name The name of your Drupal site.

$url The URL of your Drupal site.

Return value

None.

Related topics

Code

developer/hooks/core.php, line 782

<?php
function hook_ping($name = '', $url = '') {
  $feed = url('node/feed');

  $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', 'failed to notify "weblogs.com" (site)');
  }

  unset($client);
}
?>