hook_ping($name = '', $url = '')
contributions/docs/developer/hooks/core.php, line 1047
Ping another server.
This hook allows a module to notify other sites of updates on your Drupal site.
$name The name of your Drupal site.
$url The URL of your Drupal site.
None.
| Name | Description |
|---|---|
| Hooks | Allow modules to interact with the Drupal core. |
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);
}