2001-10-20 18:57:10 +00:00
<?php
// $Id$
2001-10-02 20:15:21 +00:00
function weblogs_cron() {
2001-10-31 21:31:20 +00:00
if (db_num_rows(db_query("SELECT nid FROM node WHERE status = 1 AND moderate = 0 AND (created > '". variable_get("weblogs_cron_last", time()) ."' OR changed > '". variable_get("weblogs_cron_last", time()) ."')"), 1)) {
2001-11-18 22:07:53 +00:00
weblogs_notify(variable_get("site_name", "drupal") ." - ". variable_get("site_slogan", ""), path_uri());
2001-10-02 20:15:21 +00:00
}
variable_set("weblogs_cron_last", time());
}
function weblogs_notify($name, $url) {
$client = new xmlrpc_client("/RPC2", "rpc.weblogs.com", 80);
$message = new xmlrpcmsg("weblogUpdates.ping", array(new xmlrpcval($name), new xmlrpcval($url)));
2001-10-03 20:57:01 +00:00
2001-10-02 20:15:21 +00:00
$result = $client->send($message);
if (!$result || $result->faultCode()) {
watchdog("error", "failed to notify 'weblogs.com'");
}
}
2001-10-09 21:01:47 +00:00
?>